From 9fdc6a2acd49009d56e19361391b1dbe45489fed Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 17 Nov 2009 08:32:52 +0000 Subject: [PATCH] - Second attempt to fix buttons layout on Mac OS --- src/propertiesWidget.ui | 40 +--------------------------------------- src/propertieswidget.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/src/propertiesWidget.ui b/src/propertiesWidget.ui index ca97ccf8a..006c5e5d4 100644 --- a/src/propertiesWidget.ui +++ b/src/propertiesWidget.ui @@ -52,7 +52,7 @@ 0 0 536 - 268 + 265 @@ -884,9 +884,6 @@ - - 9 - 5 @@ -901,13 +898,6 @@ - - QPushButton { -border: 1px solid rgb(85, 81, 91); -border-radius: 3px; -padding: 2px; -} - General @@ -925,13 +915,6 @@ padding: 2px; - - QPushButton { -border: 1px solid rgb(85, 81, 91); -border-radius: 3px; -padding: 2px; -} - Trackers @@ -955,13 +938,6 @@ padding: 2px; 24 - - QPushButton { -border: 1px solid rgb(85, 81, 91); -border-radius: 3px; -padding: 2px; -} - Peers @@ -979,13 +955,6 @@ padding: 2px; - - QPushButton { -border: 1px solid rgb(85, 81, 91); -border-radius: 3px; -padding: 2px; -} - URL seeds @@ -1003,13 +972,6 @@ padding: 2px; - - QPushButton { -border: 1px solid rgb(85, 81, 91); -border-radius: 3px; -padding: 2px; -} - Files diff --git a/src/propertieswidget.cpp b/src/propertieswidget.cpp index 3ce6b2581..bd7bcb5ad 100644 --- a/src/propertieswidget.cpp +++ b/src/propertieswidget.cpp @@ -49,13 +49,25 @@ #include "TorrentFilesModel.h" #include "peerlistwidget.h" +#ifdef Q_WS_MAC +#define DEFAULT_BUTTON_CSS "" +#define SELECTED_BUTTON_CSS "background-color: rgb(255, 208, 105);}" +#else #define DEFAULT_BUTTON_CSS "QPushButton {border: 1px solid rgb(85, 81, 91);border-radius: 3px;padding: 2px;}" #define SELECTED_BUTTON_CSS "QPushButton {border: 1px solid rgb(85, 81, 91);border-radius: 3px;padding: 2px;background-color: rgb(255, 208, 105);}" +#endif PropertiesWidget::PropertiesWidget(QWidget *parent, TransferListWidget *transferList, bittorrent* BTSession): QWidget(parent), transferList(transferList), BTSession(BTSession) { setupUi(this); state = VISIBLE; + // Buttons stylesheet + trackers_button->setStyleSheet(DEFAULT_BUTTON_CSS); + peers_button->setStyleSheet(DEFAULT_BUTTON_CSS); + url_seeds_button->setStyleSheet(DEFAULT_BUTTON_CSS); + files_button->setStyleSheet(DEFAULT_BUTTON_CSS); + main_infos_button->setStyleSheet(DEFAULT_BUTTON_CSS); + // Set Properties list model PropListModel = new TorrentFilesModel(); filesList->setModel(PropListModel);