aboutsummaryrefslogtreecommitdiff
path: root/lumina-config/mainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-08-12 15:34:47 -0400
committerKen Moore <moorekou@gmail.com>2015-08-12 15:34:47 -0400
commita3a66f9dda3425ffb6fd51f4d07fd4ecb7e61884 (patch)
treef7f042b9670300e6315dc7eda6e14dfe3a115428 /lumina-config/mainUI.cpp
parentAdd a new data backend to lumina-fm: DirData.h (diff)
downloadlumina-a3a66f9dda3425ffb6fd51f4d07fd4ecb7e61884.tar.gz
lumina-a3a66f9dda3425ffb6fd51f4d07fd4ecb7e61884.tar.bz2
lumina-a3a66f9dda3425ffb6fd51f4d07fd4ecb7e61884.zip
Add an extension to the Lumina theme engine/class for specifying a mouse cursor theme. This is integrated into lumina-config as well, but still have 2 problems with it:
1) The active re-loading of the new cursors does not work yet (Qt issues I am still working on) 2) The X11 Cursor file to use for the sample image cannot be loaded by Qt (need to write my own format conversion routine)
Diffstat (limited to 'lumina-config/mainUI.cpp')
-rw-r--r--lumina-config/mainUI.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp
index 5b111cf1..6bd6ba07 100644
--- a/lumina-config/mainUI.cpp
+++ b/lumina-config/mainUI.cpp
@@ -181,6 +181,7 @@ void MainUI::setupConnections(){
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(sessionthemechanged()) );
+ connect(ui->combo_session_cursortheme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionCursorChanged()) );
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()) );
@@ -238,6 +239,12 @@ void MainUI::setupMenus(){
ui->combo_session_datetimeorder->addItem( tr("Time first then Date"), "timedate");
ui->combo_session_datetimeorder->addItem( tr("Date first then Time"), "datetime");
+ //Available Cursor Themes
+ ui->combo_session_cursortheme->clear();
+ ui->combo_session_cursortheme->addItems( LTHEME::availableSystemCursors() );
+ //int cur = ui->combo_session_cursortheme->findText( LTHEME::currentCursor() );
+ //if(cur>=0){ ui->combo_session_cursortheme->setCurrentIndex(cur); }
+
//Available Time zones
ui->combo_session_timezone->clear();
QList<QByteArray> TZList = QTimeZone::availableTimeZoneIds();
@@ -1664,9 +1671,13 @@ void MainUI::loadSessionSettings(){
// - Font Size
ui->spin_session_fontsize->setValue( current[4].section("p",0,0).toInt() );
+ int cur = ui->combo_session_cursortheme->findText( LTHEME::currentCursor() );
+ if(cur>=0){ ui->combo_session_cursortheme->setCurrentIndex(cur); }
+
//sessionstartchanged(); //make sure to update buttons
sessionLoadTimeSample();
sessionLoadDateSample();
+ sessionCursorChanged();
}
void MainUI::saveSessionSettings(){
@@ -1771,7 +1782,6 @@ void MainUI::saveSessionSettings(){
sessionsettings->setValue("InitLocale/LC_CTYPE", ui->combo_locale_ctype->currentData().toString() );
-
//Now do the theme options
QString themefile = ui->combo_session_themefile->itemData( ui->combo_session_themefile->currentIndex() ).toString();
QString colorfile = ui->combo_session_colorfile->itemData( ui->combo_session_colorfile->currentIndex() ).toString();
@@ -1780,6 +1790,7 @@ void MainUI::saveSessionSettings(){
QString fontsize = QString::number(ui->spin_session_fontsize->value())+"pt";
//qDebug() << "Saving theme options:" << themefile << colorfile << iconset << font << fontsize;
LTHEME::setCurrentSettings( themefile, colorfile, iconset, font, fontsize);
+ LTHEME::setCursorTheme(ui->combo_session_cursortheme->currentText());
if(newstartapps){ loadSessionSettings(); } //make sure to re-load the session settings to catch the new files
}
@@ -1853,6 +1864,18 @@ void MainUI::sessionthemechanged(){
sessionoptchanged();
}
+void MainUI::sessionCursorChanged(){
+ //Update the Cursor Theme preview
+ QStringList info = LTHEME::cursorInformation(ui->combo_session_cursortheme->currentText());
+ // - info format: [name, comment. sample file]
+ qDebug() << "Cursor Information:" << ui->combo_session_cursortheme->currentText() << info;
+ QPixmap img(info[2]);
+ qDebug() << "Image Data:" << img.isNull() << img.size();
+ ui->label_cursor_sample->setPixmap( img.scaledToHeight(ui->label_cursor_sample->height(), Qt::SmoothTransformation) );
+ ui->label_cursor_sample->setToolTip(info[1]);
+ ui->combo_session_cursortheme->setToolTip(info[1]);
+ sessionoptchanged();
+}
/*void MainUI::sessionstartchanged(){
ui->tool_session_rmapp->setEnabled( ui->list_session_start->currentRow()>=0 );
}*/
@@ -2006,4 +2029,3 @@ void MainUI::sessionShowDateCodes(){
msg << tr("Text may be contained within single-quotes to ignore replacements");
QMessageBox::information(this, tr("Date Codes"), msg.join("\n") );
}
-
bgstack15