author | sandman <sandman> | 2002-10-04 00:42:31 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-04 00:42:31 (UTC) |
commit | 4131d24ac051733b2d9ba323b18e6602ae396b85 (patch) (unidiff) | |
tree | 928dd69609529096aa0825c4019022cb0659b46c | |
parent | 41e252c02eb10dcaa4622341f706b7817d6a70b2 (diff) | |
download | opie-4131d24ac051733b2d9ba323b18e6602ae396b85.zip opie-4131d24ac051733b2d9ba323b18e6602ae396b85.tar.gz opie-4131d24ac051733b2d9ba323b18e6602ae396b85.tar.bz2 |
- some changes to get dynamic window decorations working
- new format for style config
-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 | |||
@@ -151,3 +151,3 @@ void Appearance::loadDecos ( QListBox *list ) | |||
151 | { | 151 | { |
152 | list-> insertItem ( new DecoListItem ( tr( "Default" ))); | 152 | list-> insertItem ( new DecoListItem ( "QPE" )); |
153 | 153 | ||
@@ -210,3 +210,10 @@ QWidget *Appearance::createStyleTab ( QWidget *parent ) | |||
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 ( ); |
@@ -233,3 +240,10 @@ QWidget *Appearance::createDecoTab ( QWidget *parent ) | |||
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 ( ); |
@@ -388,2 +402,8 @@ void Appearance::accept ( ) | |||
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 | ||
@@ -471,2 +491,3 @@ void Appearance::decoClicked ( int index ) | |||
471 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 491 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
492 | m_sample-> repaint ( ); | ||
472 | } | 493 | } |
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 | |||
@@ -33,5 +33,5 @@ | |||
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 | { |
@@ -42,3 +42,3 @@ public: | |||
42 | 42 | ||
43 | DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxText ( iface-> name ( )) | 43 | DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxPixmap ( iface-> icon ( ), iface-> name ( )) |
44 | { | 44 | { |
@@ -87,4 +87,4 @@ public: | |||
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 |
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 | |||
@@ -91,4 +91,5 @@ public: | |||
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 |