From d0a262d18f173f9d8687c99fdc0b7ce73c27125c Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Sun, 30 Jun 2024 23:43:38 +0100 Subject: [PATCH] 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. --- src/clientsettingsdlg.cpp | 8 +++++--- src/clientsettingsdlgbase.ui | 27 +-------------------------- src/connectdlg.cpp | 7 ++++--- src/connectdlgbase.ui | 23 +---------------------- 4 files changed, 11 insertions(+), 54 deletions(-) diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index f4437603be..58d51701a7 100644 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -366,9 +366,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet cbxCustomDirectories->setWhatsThis ( strCustomDirectories ); cbxCustomDirectories->setAccessibleName ( tr ( "Custom Directories combo box" ) ); - butDeleteCustomDirectory->setAccessibleName ( tr ( "Delete custom directory button" ) ); - butDeleteCustomDirectory->setWhatsThis ( "" + tr ( "Delete Custom Directory" ) + ": " + + tbtDeleteCustomDirectory->setAccessibleName ( tr ( "Delete custom directory button" ) ); + tbtDeleteCustomDirectory->setWhatsThis ( "" + tr ( "Delete Custom Directory" ) + ": " + tr ( "Click the button to delete the currently selected custom directory." ) ); + tbtDeleteCustomDirectory->setText ( u8"\u232B" ); // current connection status parameter QString strConnStats = "" + tr ( "Audio Upstream Rate" ) + ": " + @@ -710,7 +711,8 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet QObject::connect ( butDriverSetup, &QPushButton::clicked, this, &CClientSettingsDlg::OnDriverSetupClicked ); #endif - QObject::connect ( butDeleteCustomDirectory, &QPushButton::clicked, this, [this] { CClientSettingsDlg::OnCustomDirectoriesChanged ( true ); } ); + // tool buttons + QObject::connect ( tbtDeleteCustomDirectory, &QToolButton::clicked, this, [this] { CClientSettingsDlg::OnCustomDirectoriesChanged ( true ); } ); // misc // sliders diff --git a/src/clientsettingsdlgbase.ui b/src/clientsettingsdlgbase.ui index 404ff39ecc..89611505da 100644 --- a/src/clientsettingsdlgbase.ui +++ b/src/clientsettingsdlgbase.ui @@ -1048,32 +1048,7 @@ - - - - 0 - 0 - - - - - 24 - 16777215 - - - - - 75 - true - - - - - - - false - - + diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index 790867aa4e..bc5190aa81 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -96,10 +96,11 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR cbxServerAddr->setAccessibleName ( tr ( "Server address edit box" ) ); cbxServerAddr->setAccessibleDescription ( tr ( "Holds the current server address. It also stores old addresses in the combo box list." ) ); - butDeleteServerAddr->setAccessibleName ( tr ( "Delete server address button" ) ); - butDeleteServerAddr->setWhatsThis ( "" + tr ( "Delete Server Address" ) + ": " + + tbtDeleteServerAddr->setAccessibleName ( tr ( "Delete server address button" ) ); + tbtDeleteServerAddr->setWhatsThis ( "" + tr ( "Delete Server Address" ) + ": " + tr ( "Click the button to clear the currently selected server address " "and delete it from the list of stored servers." ) ); + tbtDeleteServerAddr->setText ( u8"\u232B" ); UpdateDirectoryComboBox(); @@ -185,7 +186,7 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR QObject::connect ( butConnect, &QPushButton::clicked, this, &CConnectDlg::OnConnectClicked ); // tool buttons - QObject::connect ( butDeleteServerAddr, &QPushButton::clicked, this, &CConnectDlg::OnDeleteServerAddrClicked ); + QObject::connect ( tbtDeleteServerAddr, &QToolButton::clicked, this, &CConnectDlg::OnDeleteServerAddrClicked ); // timers QObject::connect ( &TimerPing, &QTimer::timeout, this, &CConnectDlg::OnTimerPing ); diff --git a/src/connectdlgbase.ui b/src/connectdlgbase.ui index 777b4f0848..279c76dc0b 100644 --- a/src/connectdlgbase.ui +++ b/src/connectdlgbase.ui @@ -108,28 +108,7 @@ - - - - 0 - 0 - - - - - 24 - 16777215 - - - - - true - - - - - - +