Skip to content

Commit d0a262d

Browse files
committed
Convert delete buttons to QToolButton
This fixes the width problem on Mac, and also makes them consistent with the delete buttons in the Server GUI Options dialog.
1 parent 784d7b7 commit d0a262d

4 files changed

Lines changed: 11 additions & 54 deletions

File tree

src/clientsettingsdlg.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
366366
cbxCustomDirectories->setWhatsThis ( strCustomDirectories );
367367
cbxCustomDirectories->setAccessibleName ( tr ( "Custom Directories combo box" ) );
368368

369-
butDeleteCustomDirectory->setAccessibleName ( tr ( "Delete custom directory button" ) );
370-
butDeleteCustomDirectory->setWhatsThis ( "<b>" + tr ( "Delete Custom Directory" ) + ":</b> " +
369+
tbtDeleteCustomDirectory->setAccessibleName ( tr ( "Delete custom directory button" ) );
370+
tbtDeleteCustomDirectory->setWhatsThis ( "<b>" + tr ( "Delete Custom Directory" ) + ":</b> " +
371371
tr ( "Click the button to delete the currently selected custom directory." ) );
372+
tbtDeleteCustomDirectory->setText ( u8"\u232B" );
372373

373374
// current connection status parameter
374375
QString strConnStats = "<b>" + tr ( "Audio Upstream Rate" ) + ":</b> " +
@@ -710,7 +711,8 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
710711
QObject::connect ( butDriverSetup, &QPushButton::clicked, this, &CClientSettingsDlg::OnDriverSetupClicked );
711712
#endif
712713

713-
QObject::connect ( butDeleteCustomDirectory, &QPushButton::clicked, this, [this] { CClientSettingsDlg::OnCustomDirectoriesChanged ( true ); } );
714+
// tool buttons
715+
QObject::connect ( tbtDeleteCustomDirectory, &QToolButton::clicked, this, [this] { CClientSettingsDlg::OnCustomDirectoriesChanged ( true ); } );
714716

715717
// misc
716718
// sliders

src/clientsettingsdlgbase.ui

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,32 +1048,7 @@
10481048
</widget>
10491049
</item>
10501050
<item>
1051-
<widget class="QPushButton" name="butDeleteCustomDirectory">
1052-
<property name="sizePolicy">
1053-
<sizepolicy hsizetype="Maximum" vsizetype="Ignored">
1054-
<horstretch>0</horstretch>
1055-
<verstretch>0</verstretch>
1056-
</sizepolicy>
1057-
</property>
1058-
<property name="maximumSize">
1059-
<size>
1060-
<width>24</width>
1061-
<height>16777215</height>
1062-
</size>
1063-
</property>
1064-
<property name="font">
1065-
<font>
1066-
<weight>75</weight>
1067-
<bold>true</bold>
1068-
</font>
1069-
</property>
1070-
<property name="text">
1071-
<string notr="true">⌫</string>
1072-
</property>
1073-
<property name="autoDefault">
1074-
<bool>false</bool>
1075-
</property>
1076-
</widget>
1051+
<widget class="QToolButton" name="tbtDeleteCustomDirectory"/>
10771052
</item>
10781053
</layout>
10791054
</item>

src/connectdlg.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR
9696
cbxServerAddr->setAccessibleName ( tr ( "Server address edit box" ) );
9797
cbxServerAddr->setAccessibleDescription ( tr ( "Holds the current server address. It also stores old addresses in the combo box list." ) );
9898

99-
butDeleteServerAddr->setAccessibleName ( tr ( "Delete server address button" ) );
100-
butDeleteServerAddr->setWhatsThis ( "<b>" + tr ( "Delete Server Address" ) + ":</b> " +
99+
tbtDeleteServerAddr->setAccessibleName ( tr ( "Delete server address button" ) );
100+
tbtDeleteServerAddr->setWhatsThis ( "<b>" + tr ( "Delete Server Address" ) + ":</b> " +
101101
tr ( "Click the button to clear the currently selected server address "
102102
"and delete it from the list of stored servers." ) );
103+
tbtDeleteServerAddr->setText ( u8"\u232B" );
103104

104105
UpdateDirectoryComboBox();
105106

@@ -185,7 +186,7 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR
185186
QObject::connect ( butConnect, &QPushButton::clicked, this, &CConnectDlg::OnConnectClicked );
186187

187188
// tool buttons
188-
QObject::connect ( butDeleteServerAddr, &QPushButton::clicked, this, &CConnectDlg::OnDeleteServerAddrClicked );
189+
QObject::connect ( tbtDeleteServerAddr, &QToolButton::clicked, this, &CConnectDlg::OnDeleteServerAddrClicked );
189190

190191
// timers
191192
QObject::connect ( &TimerPing, &QTimer::timeout, this, &CConnectDlg::OnTimerPing );

src/connectdlgbase.ui

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -108,28 +108,7 @@
108108
</widget>
109109
</item>
110110
<item>
111-
<widget class="QPushButton" name="butDeleteServerAddr">
112-
<property name="sizePolicy">
113-
<sizepolicy hsizetype="Maximum" vsizetype="Ignored">
114-
<horstretch>0</horstretch>
115-
<verstretch>0</verstretch>
116-
</sizepolicy>
117-
</property>
118-
<property name="maximumSize">
119-
<size>
120-
<width>24</width>
121-
<height>16777215</height>
122-
</size>
123-
</property>
124-
<property name="font">
125-
<font>
126-
<bold>true</bold>
127-
</font>
128-
</property>
129-
<property name="text">
130-
<string notr="true">⌫</string>
131-
</property>
132-
</widget>
111+
<widget class="QToolButton" name="tbtDeleteServerAddr"/>
133112
</item>
134113
</layout>
135114
</item>

0 commit comments

Comments
 (0)