Use theme in the main window.

This commit is contained in:
Luis Ángel San Martín 2018-09-14 10:03:41 +02:00 committed by Luis Ángel San Martín
parent 8881ef885d
commit c943dd205f
2 changed files with 23 additions and 16 deletions

View File

@ -169,12 +169,9 @@ void LibraryWindow::setupUI()
void LibraryWindow::doLayout()
{
//LAYOUT ELEMENTS------------------------------------------------------------
auto sHorizontal = new QSplitter(Qt::Horizontal); //spliter principal
#ifdef Q_OS_MAC
sHorizontal->setStyleSheet("QSplitter::handle{image:none;background-color:#B8B8B8;} QSplitter::handle:vertical {height:1px;}");
#else
sHorizontal->setStyleSheet("QSplitter::handle:vertical {height:4px;}");
#endif
auto sHorizontal = new QSplitter(Qt::Horizontal); //spliter principal
sHorizontal->setStyleSheet(theme.mainWindowHorizontalSpliterStyle);
//TOOLBARS-------------------------------------------------------------------
//---------------------------------------------------------------------------
@ -265,9 +262,9 @@ void LibraryWindow::doLayout()
connect(noLibrariesWidget, SIGNAL(addExistingLibrary()), this, SLOT(showAddLibrary()));
//collapsible disabled in macosx (only temporaly)
#ifdef Q_OS_MAC
sHorizontal->setCollapsible(0, false);
#endif
if (theme.isMacosNative) {
sHorizontal->setCollapsible(0,false);
}
}
void LibraryWindow::doDialogs()
@ -1701,7 +1698,8 @@ void LibraryWindow::createLibrary()
void LibraryWindow::create(QString source, QString dest, QString name)
{
QLOG_INFO() << QString("About to create a library from '%1' to '%2' with name '%3'").arg(source).arg(dest).arg(name);
libraryCreator->createLibrary(source, dest);
libraryCreator->createLibrary(source,dest);
libraryCreator->start();
_lastAdded = name;
_sourceLastAdded = source;
@ -2250,9 +2248,10 @@ void LibraryWindow::showNoLibrariesWidget()
void LibraryWindow::showRootWidget()
{
#ifndef Q_OS_MAC
libraryToolBar->setDisabled(false);
#endif
if (!theme.isMacosNative) {
libraryToolBar->setDisabled(false);
}
libraryToolBar->searchEdit->setEnabled(true);
mainWidget->setCurrentIndex(0);
}
@ -2261,9 +2260,11 @@ void LibraryWindow::showImportingWidget()
{
disableAllActions();
importWidget->clear();
#ifndef Q_OS_MAC
libraryToolBar->setDisabled(true);
#endif
if (!theme.isMacosNative) {
libraryToolBar->setDisabled(true);
}
libraryToolBar->searchEdit->setDisabled(true);
mainWidget->setCurrentIndex(2);
}

View File

@ -117,6 +117,8 @@ public:
"QHeaderView::section:horizontal {background-color:#F5F5F5; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4); border-left:none; border-top:none; padding:4px; color:#313232;}"
"QHeaderView::section:vertical {border-bottom: 1px solid #DFDFDF;border-top: 1px solid #FEFEFE;}";
t.mainWindowHorizontalSpliterStyle = "QSplitter::handle{image:none;background-color:#B8B8B8;} QSplitter::handle:vertical {height:1px;}";
} else {
t.isMacosNative = false;
#ifdef Q_OS_MAC
@ -235,6 +237,7 @@ public:
"QHeaderView::section:horizontal {background-color:#F5F5F5; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4); border-left:none; border-top:none; padding:4px; color:#313232;}"
"QHeaderView::section:vertical {border-bottom: 1px solid #DFDFDF;border-top: 1px solid #FEFEFE;}";
t.mainWindowHorizontalSpliterStyle = "QSplitter::handle:vertical {height:4px;}";
}
return t;
@ -360,6 +363,9 @@ public:
//TableView (comics)
QString tableViewStyle;
//Main window
QString mainWindowHorizontalSpliterStyle;
};
#endif // THEME_H