Skip to content

Commit

Permalink
Fix: improve symbols on map pan buttons (Mudlet#6982)
Browse files Browse the repository at this point in the history
#### Brief overview of PR changes/additions
This PR converts all 6 of the pan control buttons into `QToolButton`s
which have the feature that Qt can itself generate triangular "Arrow"
icons for - which *might* avoid the "emojification" that was taking
place in the current release code for some OS/Font combinations. The two
Z direction buttons do not have such arrows and retain their original
"+" or "-" text.

#### Motivation for adding to Mudlet
On some MacOS users machines the map pan buttons are not included in the
font that is being used to render the mapper controls. One user has
suggested that we try some arrow symbols instead and I tried that
already in PR Mudlet#6981. However those did seem a bit thin and I have an
alternative that I wish to test here.

#### Other info (issues closed, discussion etc)
This may close Mudlet#5454.

Only one of this and Mudlet#6981 should be needed. 😀

Signed-off-by: Stephen Lyons <[email protected]>
  • Loading branch information
SlySven authored Nov 22, 2023
1 parent 6789ffa commit dd5da3f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
24 changes: 12 additions & 12 deletions src/dlgMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ dlgMapper::dlgMapper( QWidget * parent, Host * pH, TMap * pM )

widget_panel->setVisible(mpHost->mShowPanel);
connect(checkBox_roundRooms, &QAbstractButton::clicked, this, &dlgMapper::slot_toggleRoundRooms);
connect(pushButton_shiftZup, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftZup);
connect(pushButton_shiftZdown, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftZdown);
connect(pushButton_shiftLeft, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftLeft);
connect(pushButton_shiftRight, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftRight);
connect(pushButton_shiftUp, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftUp);
connect(pushButton_shiftDown, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftDown);
connect(toolButton_shiftZup, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftZup);
connect(toolButton_shiftZdown, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftZdown);
connect(toolButton_shiftLeft, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftLeft);
connect(toolButton_shiftRight, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftRight);
connect(toolButton_shiftUp, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftUp);
connect(toolButton_shiftDown, &QAbstractButton::clicked, mp2dMap, &T2DMap::slot_shiftDown);
connect(spinBox_exitSize, qOverload<int>(&QSpinBox::valueChanged), this, &dlgMapper::slot_exitSize);
connect(spinBox_roomSize, qOverload<int>(&QSpinBox::valueChanged), this, &dlgMapper::slot_roomSize);
connect(toolButton_togglePanel, &QAbstractButton::clicked, this, &dlgMapper::slot_togglePanel);
Expand Down Expand Up @@ -250,12 +250,12 @@ void dlgMapper::slot_toggle3DView(const bool is3DMode)
connect(pushButton_increaseBottom, &QAbstractButton::clicked, glWidget, &GLWidget::slot_showMoreLowerLevels);
connect(pushButton_reduceTop, &QAbstractButton::clicked, glWidget, &GLWidget::slot_showLessUpperLevels);
connect(pushButton_reduceBottom, &QAbstractButton::clicked, glWidget, &GLWidget::slot_showLessLowerLevels);
connect(pushButton_shiftZup, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftZup);
connect(pushButton_shiftZdown, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftZdown);
connect(pushButton_shiftLeft, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftLeft);
connect(pushButton_shiftRight, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftRight);
connect(pushButton_shiftUp, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftUp);
connect(pushButton_shiftDown, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftDown);
connect(toolButton_shiftZup, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftZup);
connect(toolButton_shiftZdown, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftZdown);
connect(toolButton_shiftLeft, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftLeft);
connect(toolButton_shiftRight, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftRight);
connect(toolButton_shiftUp, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftUp);
connect(toolButton_shiftDown, &QAbstractButton::clicked, glWidget, &GLWidget::slot_shiftDown);
connect(pushButton_defaultView, &QAbstractButton::clicked, glWidget, &GLWidget::slot_defaultView);
connect(pushButton_sideView, &QAbstractButton::clicked, glWidget, &GLWidget::slot_sideView);
connect(pushButton_topView, &QAbstractButton::clicked, glWidget, &GLWidget::slot_topView);
Expand Down
40 changes: 22 additions & 18 deletions src/ui/mapper.ui
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButton_shiftLeft">
<widget class="QToolButton" name="toolButton_shiftLeft">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand All @@ -192,22 +192,19 @@
<height>0</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string notr="true">⯇</string>
<string />
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_shiftUp">
<widget class="QToolButton" name="toolButton_shiftUp">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand All @@ -233,15 +230,18 @@
</size>
</property>
<property name="text">
<string notr="true">⯆</string>
<string />
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::DownArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_shiftDown">
<widget class="QToolButton" name="toolButton_shiftDown">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand All @@ -267,15 +267,18 @@
</size>
</property>
<property name="text">
<string notr="true">⯅</string>
<string />
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::UpArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_shiftRight">
<widget class="QToolButton" name="toolButton_shiftRight">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand All @@ -301,15 +304,18 @@
</size>
</property>
<property name="text">
<string notr="true">⯈</string>
<string />
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_shiftZup">
<widget class="QToolButton" name="toolButton_shiftZup">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>25</horstretch>
Expand All @@ -336,7 +342,6 @@
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand All @@ -346,7 +351,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_shiftZdown">
<widget class="QToolButton" name="toolButton_shiftZdown">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand All @@ -373,7 +378,6 @@
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down

0 comments on commit dd5da3f

Please sign in to comment.