From 9e1d3ed668b9ace2d5d2297f6288906ea181fff9 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 1 Oct 2014 10:21:53 -0400 Subject: Add a Fluxbox Window theme preview to lumina-config --- lumina-config/mainUI.cpp | 14 +++- lumina-config/mainUI.h | 1 + lumina-config/mainUI.ui | 168 ++++++++++++++++++++++++++++++++++------------- 3 files changed, 137 insertions(+), 46 deletions(-) (limited to 'lumina-config') diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 110149f2..c366b07c 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -189,7 +189,7 @@ void MainUI::setupConnections(){ connect(ui->tool_session_rmapp, SIGNAL(clicked()), this, SLOT(rmsessionstartitem()) ); connect(ui->combo_session_wfocus, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->combo_session_wloc, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); - connect(ui->combo_session_wtheme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->combo_session_wtheme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionthemechanged()) ); connect(ui->check_session_numlock, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->check_session_playloginaudio, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->check_session_playlogoutaudio, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); @@ -1428,6 +1428,18 @@ void MainUI::sessionoptchanged(){ } } +void MainUI::sessionthemechanged(){ + //Update the Fluxbox Theme preview + QString previewfile = ui->combo_session_wtheme->itemData( ui->combo_session_wtheme->currentIndex() ).toString(); + previewfile.append( (previewfile.endsWith("/") ? "preview.jpg": "/preview.jpg") ); + if(QFile::exists(previewfile)){ + ui->label_session_wpreview->setPixmap(QPixmap(previewfile)); + }else{ + ui->label_session_wpreview->setText(tr("No Preview Available")); + } + sessionoptchanged(); +} + void MainUI::sessionstartchanged(){ ui->tool_session_rmapp->setEnabled( ui->list_session_start->currentRow()>=0 ); } diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h index 14858db4..459bc9e7 100644 --- a/lumina-config/mainUI.h +++ b/lumina-config/mainUI.h @@ -146,6 +146,7 @@ private slots: void addsessionstartbin(); void addsessionstartfile(); void sessionoptchanged(); + void sessionthemechanged(); void sessionstartchanged(); }; diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index 44ac52d0..f1fd2542 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -94,7 +94,7 @@ QFrame::StyledPanel - 3 + 5 @@ -1083,7 +1083,7 @@ - 0 + 2 @@ -1189,52 +1189,130 @@ Window System - - - - - New Window Placement - - - - - - - - - - Focus Policy - - - - - - - - - - Window Theme - - - - - - - - - - Number of Workspaces - - + + + + + + + Number of Workspaces + + + + + + + 1 + + + 10 + + + + + + + New Window Placement + + + + + + + + + + Focus Policy + + + + + + + + + + Window Theme + + + + + + + - - - - 1 + + + + + 0 + 0 + - - 10 + + Window Theme Preview + + + + + background: grey; + + + true + + + + + 0 + 0 + 509 + 71 + + + + + 0 + 0 + + + + + 1 + + + + + + 0 + 0 + + + + + + + QFrame::NoFrame + + + QFrame::Sunken + + + No Preview Available + + + false + + + Qt::AlignCenter + + + + + + + + -- cgit