-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/appearance2/decolistitem.h | 10 | ||||
-rw-r--r-- | noncore/settings/appearance2/stylelistitem.h | 5 |
3 files changed, 32 insertions, 10 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index 43ff24c..8cd54a2 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -150,5 +150,5 @@ void Appearance::loadStyles ( QListBox *list ) | |||
150 | void Appearance::loadDecos ( QListBox *list ) | 150 | void Appearance::loadDecos ( QListBox *list ) |
151 | { | 151 | { |
152 | list-> insertItem ( new DecoListItem ( tr( "Default" ))); | 152 | list-> insertItem ( new DecoListItem ( "QPE" )); |
153 | 153 | ||
154 | { | 154 | { |
@@ -209,5 +209,12 @@ QWidget *Appearance::createStyleTab ( QWidget *parent ) | |||
209 | 209 | ||
210 | QString s = config. readEntry ( "Style", "Light" ); | 210 | QString s = config. readEntry ( "Style", "Light" ); |
211 | m_style_list-> setCurrentItem ( m_style_list-> findItem ( s )); | 211 | |
212 | for ( uint i = 0; i < m_style_list-> count ( ); i++ ) { | ||
213 | if (((StyleListItem *) m_style_list-> item ( i ))-> key ( ) == s ) { | ||
214 | m_style_list-> setCurrentItem ( i ); | ||
215 | break; | ||
216 | } | ||
217 | } | ||
218 | |||
212 | m_original_style = m_style_list-> currentItem ( ); | 219 | m_original_style = m_style_list-> currentItem ( ); |
213 | styleClicked ( m_original_style ); | 220 | styleClicked ( m_original_style ); |
@@ -232,5 +239,12 @@ QWidget *Appearance::createDecoTab ( QWidget *parent ) | |||
232 | 239 | ||
233 | QString s = config. readEntry ( "Decoration" ); | 240 | QString s = config. readEntry ( "Decoration" ); |
234 | m_deco_list-> setCurrentItem ( m_deco_list-> findItem ( s )); | 241 | |
242 | for ( uint i = 0; i < m_deco_list-> count ( ); i++ ) { | ||
243 | if (((DecoListItem *) m_deco_list-> item ( i ))-> key ( ) == s ) { | ||
244 | m_deco_list-> setCurrentItem ( i ); | ||
245 | break; | ||
246 | } | ||
247 | } | ||
248 | |||
235 | m_original_deco = m_deco_list-> currentItem ( ); | 249 | m_original_deco = m_deco_list-> currentItem ( ); |
236 | if ( m_deco_list-> currentItem ( ) < 0 ) | 250 | if ( m_deco_list-> currentItem ( ) < 0 ) |
@@ -387,4 +401,10 @@ void Appearance::accept ( ) | |||
387 | config.writeEntry( "Style", item-> key ( )); | 401 | config.writeEntry( "Style", item-> key ( )); |
388 | } | 402 | } |
403 | |||
404 | if ( m_deco_changed ) { | ||
405 | DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); | ||
406 | if ( item ) | ||
407 | config.writeEntry( "Decoration", item-> key ( )); | ||
408 | } | ||
389 | 409 | ||
390 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { | 410 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { |
@@ -470,4 +490,5 @@ void Appearance::decoClicked ( int index ) | |||
470 | else | 490 | else |
471 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 491 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
492 | m_sample-> repaint ( ); | ||
472 | } | 493 | } |
473 | m_deco_changed |= ( index != m_original_deco ); | 494 | m_deco_changed |= ( index != m_original_deco ); |
diff --git a/noncore/settings/appearance2/decolistitem.h b/noncore/settings/appearance2/decolistitem.h index 23261b1..d190ceb 100644 --- a/noncore/settings/appearance2/decolistitem.h +++ b/noncore/settings/appearance2/decolistitem.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <qlistbox.h> | 32 | #include <qlistbox.h> |
33 | 33 | ||
34 | class DecoListItem : public QListBoxText { | 34 | class DecoListItem : public QListBoxPixmap { |
35 | public: | 35 | public: |
36 | DecoListItem ( const QString &t ) : QListBoxText ( t ) | 36 | DecoListItem ( const QString &t ) : QListBoxPixmap ( QPixmap ( ), t ) |
37 | { | 37 | { |
38 | m_lib = 0; | 38 | m_lib = 0; |
@@ -41,5 +41,5 @@ public: | |||
41 | } | 41 | } |
42 | 42 | ||
43 | DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxText ( iface-> name ( )) | 43 | DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxPixmap ( iface-> icon ( ), iface-> name ( )) |
44 | { | 44 | { |
45 | m_lib = lib; | 45 | m_lib = lib; |
@@ -86,6 +86,6 @@ public: | |||
86 | QString key ( ) | 86 | QString key ( ) |
87 | { | 87 | { |
88 | if ( m_window_if ) | 88 | if ( m_lib ) |
89 | return QString ( m_window_if-> name ( )); | 89 | return QFileInfo ( m_lib-> library ( )). fileName ( ); |
90 | else | 90 | else |
91 | return text ( ); | 91 | return text ( ); |
diff --git a/noncore/settings/appearance2/stylelistitem.h b/noncore/settings/appearance2/stylelistitem.h index c0258e0..e261511 100644 --- a/noncore/settings/appearance2/stylelistitem.h +++ b/noncore/settings/appearance2/stylelistitem.h | |||
@@ -90,6 +90,7 @@ public: | |||
90 | QString key ( ) | 90 | QString key ( ) |
91 | { | 91 | { |
92 | if ( m_style_if ) | 92 | if ( m_lib ) |
93 | return QString ( m_style_if-> key ( )); | 93 | return QFileInfo ( m_lib-> library ( )). fileName ( ); |
94 | //return QString ( m_style_if-> key ( )); | ||
94 | else | 95 | else |
95 | return text ( ); | 96 | return text ( ); |