From bb2e55d0b63a0c624fa9dadaa80254a60bf9b4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Mon, 19 Jan 2015 21:49:27 +0100 Subject: [PATCH] fixed some graphic styles in MacOSX --- YACReaderLibrary/images_osx.qrc | 1 - YACReaderLibrary/library_window.cpp | 2 ++ custom_widgets/yacreader_library_item_widget.cpp | 5 +++-- custom_widgets/yacreader_sidebar.cpp | 7 +------ custom_widgets/yacreader_titled_toolbar.cpp | 4 ++++ custom_widgets/yacreader_treeview.cpp | 8 ++++---- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/YACReaderLibrary/images_osx.qrc b/YACReaderLibrary/images_osx.qrc index 5fc31827..1f4c3a18 100644 --- a/YACReaderLibrary/images_osx.qrc +++ b/YACReaderLibrary/images_osx.qrc @@ -60,6 +60,5 @@ ../images/lists/label_white_osx@2x.png ../images/lists/label_yellow_osx@2x.png ../images/lists/list_osx@2x.png - ../images/empty_reading_list_osx@2x.png diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index b061fbbb..e45d8d13 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -788,7 +788,9 @@ void LibraryWindow::createActions() this->addAction(setFolderAsNotCompletedAction); this->addAction(setFolderAsReadAction); this->addAction(setFolderAsUnreadAction); +#ifndef Q_OS_MAC this->addAction(toggleFullScreenAction); +#endif //disable actions disableAllActions(); diff --git a/custom_widgets/yacreader_library_item_widget.cpp b/custom_widgets/yacreader_library_item_widget.cpp index 245b2a2f..3a6d89f1 100644 --- a/custom_widgets/yacreader_library_item_widget.cpp +++ b/custom_widgets/yacreader_library_item_widget.cpp @@ -134,9 +134,10 @@ void YACReaderLibraryItemWidget::deselect() void YACReaderLibraryItemWidget::select() { #ifdef Q_OS_MAC - QString styleSheet ="color: white; background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6BAFE4, stop: 1 #3984D2); border-top: 2px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5EA3DF, stop: 1 #73B8EA); border-left:none;border-right:none;border-bottom:1px solid #3577C2;"; + //QString styleSheet ="color: white; background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6BAFE4, stop: 1 #3984D2); border-top: 2px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5EA3DF, stop: 1 #73B8EA); border-left:none;border-right:none;border-bottom:1px solid #3577C2;"; + QString styleSheet = "color: white; background-color:#91c4f4; border-bottom:1px solid #91c4f4;"; #else - QString styleSheet = "color: white; background-color:#2E2E2E; font-weight:bold;"; + QString styleSheet = "color: white; background-color:#2E2E2E; font-weight:bold;"; #endif setStyleSheet(styleSheet); diff --git a/custom_widgets/yacreader_sidebar.cpp b/custom_widgets/yacreader_sidebar.cpp index c68279d8..26fd86c5 100644 --- a/custom_widgets/yacreader_sidebar.cpp +++ b/custom_widgets/yacreader_sidebar.cpp @@ -150,12 +150,7 @@ void YACReaderSideBar::paintEvent(QPaintEvent * event) #ifdef Q_OS_MAC QPainter painter(this); - QLinearGradient lG(0,0,0,height()); - - lG.setColorAt(0,QColor("#E8ECF1")); - lG.setColorAt(1,QColor("#D1D8E0")); - - painter.fillRect(0,0,width(),height(),lG); + painter.fillRect(0,0,width(),height(),QColor("#F6F0F2")); #else QPainter painter(this); diff --git a/custom_widgets/yacreader_titled_toolbar.cpp b/custom_widgets/yacreader_titled_toolbar.cpp index b23c22b9..e47139f7 100644 --- a/custom_widgets/yacreader_titled_toolbar.cpp +++ b/custom_widgets/yacreader_titled_toolbar.cpp @@ -118,7 +118,11 @@ void YACReaderTitledToolBar::addSepartor() QWidget * w = new QWidget(this); w->setFixedSize(1,14); +#ifdef Q_OS_MAC + w->setStyleSheet("QWidget {background-color:#AFAFAF;}"); +#else w->setStyleSheet("QWidget {background-color:#6F6F6F;}"); +#endif mainLayout->addSpacing(10); mainLayout->addWidget(w); diff --git a/custom_widgets/yacreader_treeview.cpp b/custom_widgets/yacreader_treeview.cpp index 6f987686..29d64301 100644 --- a/custom_widgets/yacreader_treeview.cpp +++ b/custom_widgets/yacreader_treeview.cpp @@ -21,7 +21,7 @@ YACReaderTreeView::YACReaderTreeView(QWidget *parent) : #ifdef Q_OS_MAC bool oldStyle = false; - switch (QSysInfo::MacVersion()) + /*switch (QSysInfo::MacVersion()) { case QSysInfo::MV_SNOWLEOPARD: case QSysInfo::MV_LION: @@ -32,7 +32,7 @@ YACReaderTreeView::YACReaderTreeView(QWidget *parent) : default: oldStyle = false; break; - } + }*/ if(oldStyle) { @@ -56,8 +56,8 @@ YACReaderTreeView::YACReaderTreeView(QWidget *parent) : else { setStyleSheet("QTreeView {background-color:transparent; border: none;}" - "QTreeView::item:selected {background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6BAFE4, stop: 1 #3984D2); border-top: 2px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5EA3DF, stop: 1 #73B8EA); border-left:none;border-right:none;border-bottom:1px solid #3577C2;}" - "QTreeView::branch:selected {background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6BAFE4, stop: 1 #3984D2); border-top: 2px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5EA3DF, stop: 1 #73B8EA); border-left:none;border-right:none;border-bottom:1px solid #3577C2;}" + "QTreeView::item:selected {background-color:#91c4f4; border-top: 1px solid #91c4f4; border-left:none;border-right:none;border-bottom:1px solid #91c4f4;}" + "QTreeView::branch:selected {background-color:#91c4f4; border-top: 1px solid #91c4f4; border-left:none;border-right:none;border-bottom:1px solid #91c4f4;}" "QTreeView::branch:open:selected:has-children {image: url(':/images/expanded_branch_osx.png');}" "QTreeView::branch:closed:selected:has-children {image: url(':/images/collapsed_branch_osx.png');}"