aboutsummaryrefslogtreecommitdiff
path: root/lumina-config
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
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')
-rw-r--r--lumina-config/mainUI.cpp26
-rw-r--r--lumina-config/mainUI.h1
-rw-r--r--lumina-config/mainUI.ui53
3 files changed, 73 insertions, 7 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") );
}
-
diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h
index ee5b5feb..1810c7b6 100644
--- a/lumina-config/mainUI.h
+++ b/lumina-config/mainUI.h
@@ -151,6 +151,7 @@ private slots:
void addsessionstartfile();
void sessionoptchanged();
void sessionthemechanged();
+ void sessionCursorChanged();
//void sessionstartchanged();
void sessionEditColor();
void sessionEditTheme();
diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui
index eee44aa5..aa7024d3 100644
--- a/lumina-config/mainUI.ui
+++ b/lumina-config/mainUI.ui
@@ -109,7 +109,7 @@
<enum>QFrame::StyledPanel</enum>
</property>
<property name="currentIndex">
- <number>4</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="page_desktop">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -370,6 +370,49 @@
<item row="4" column="1">
<widget class="QComboBox" name="combo_session_icontheme"/>
</item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_31">
+ <property name="text">
+ <string>Mouse Cursors:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QComboBox" name="combo_session_cursortheme">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_cursor_sample">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
</widget>
@@ -570,8 +613,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>27</width>
- <height>16</height>
+ <width>98</width>
+ <height>28</height>
</rect>
</property>
</widget>
@@ -1447,8 +1490,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>518</width>
- <height>139</height>
+ <width>117</width>
+ <height>28</height>
</rect>
</property>
<property name="sizePolicy">
bgstack15