-rw-r--r-- | noncore/styles/liquid/liquidset.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/styles/liquid/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp index ea0b3c9..255456c 100644 --- a/noncore/styles/liquid/liquidset.cpp +++ b/noncore/styles/liquid/liquidset.cpp | |||
@@ -43,120 +43,122 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
43 | { | 43 | { |
44 | setCaption ( tr( "Liquid Style" ) ); | 44 | setCaption ( tr( "Liquid Style" ) ); |
45 | 45 | ||
46 | Config config ( "qpe" ); | 46 | Config config ( "qpe" ); |
47 | config. setGroup ( "Liquid-Style" ); | 47 | config. setGroup ( "Liquid-Style" ); |
48 | 48 | ||
49 | m_type = config. readNumEntry ( "Type", TransStippleBg ); | 49 | m_type = config. readNumEntry ( "Type", TransStippleBg ); |
50 | QColor mcol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); | 50 | QColor mcol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); |
51 | QColor tcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); | 51 | QColor tcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); |
52 | int opacity = config. readNumEntry ( "Opacity", 10 ); | 52 | int opacity = config. readNumEntry ( "Opacity", 10 ); |
53 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | 53 | m_shadow = config. readBoolEntry ( "ShadowText", true ); |
54 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | 54 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); |
55 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); | 55 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); |
56 | 56 | ||
57 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | 57 | QVBoxLayout *vbox = new QVBoxLayout ( this ); |
58 | vbox-> setSpacing ( 3 ); | 58 | vbox-> setSpacing ( 3 ); |
59 | vbox-> setMargin ( 4 ); | 59 | vbox-> setMargin ( 4 ); |
60 | 60 | ||
61 | QComboBox *cb = new QComboBox ( this ); | 61 | QComboBox *cb = new QComboBox ( this ); |
62 | cb-> insertItem ( tr( "No translucency" ), None ); | 62 | cb-> insertItem ( tr( "No translucency" ), None ); |
63 | cb-> insertItem ( tr( "Stippled, background color" ), StippledBg ); | 63 | cb-> insertItem ( tr( "Stippled, background color" ), StippledBg ); |
64 | cb-> insertItem ( tr( "Stippled, button color" ), StippledBtn ); | 64 | cb-> insertItem ( tr( "Stippled, button color" ), StippledBtn ); |
65 | cb-> insertItem ( tr( "Translucent stippled, background color" ), TransStippleBg ); | 65 | cb-> insertItem ( tr( "Translucent stippled, background color" ), TransStippleBg ); |
66 | cb-> insertItem ( tr( "Translucent stippled, button color" ), TransStippleBtn ); | 66 | cb-> insertItem ( tr( "Translucent stippled, button color" ), TransStippleBtn ); |
67 | cb-> insertItem ( tr( "Custom translucency" ), Custom ); | 67 | cb-> insertItem ( tr( "Custom translucency" ), Custom ); |
68 | 68 | ||
69 | cb-> setCurrentItem ( m_type ); | 69 | cb-> setCurrentItem ( m_type ); |
70 | vbox-> addWidget ( cb ); | 70 | vbox-> addWidget ( cb ); |
71 | 71 | ||
72 | 72 | ||
73 | QGridLayout *grid = new QGridLayout ( vbox ); | 73 | QGridLayout *grid = new QGridLayout ( vbox ); |
74 | grid-> addColSpacing ( 0, 16 ); | 74 | grid-> addColSpacing ( 0, 16 ); |
75 | grid-> addColSpacing ( 3, 8 ); | 75 | grid-> addColSpacing ( 3, 8 ); |
76 | 76 | ||
77 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); | 77 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); |
78 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); | 78 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); |
79 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); | 79 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); |
80 | 80 | ||
81 | m_menubtn = new OColorButton ( this ); | 81 | m_menubtn = new OColorButton ( this ); |
82 | m_menubtn-> setColor ( mcol ); | 82 | m_menubtn-> setColor ( mcol ); |
83 | grid-> addWidget ( m_menubtn, 0, 2 ); | 83 | grid-> addWidget ( m_menubtn, 0, 2 ); |
84 | 84 | ||
85 | m_textbtn = new OColorButton ( this ); | 85 | m_textbtn = new OColorButton ( this ); |
86 | m_textbtn-> setColor ( tcol ); | 86 | m_textbtn-> setColor ( tcol ); |
87 | grid-> addWidget ( m_textbtn, 0, 5 ); | 87 | grid-> addWidget ( m_textbtn, 0, 5 ); |
88 | 88 | ||
89 | m_opacsld = new QSlider ( Horizontal, this ); | 89 | m_opacsld = new QSlider ( Horizontal, this ); |
90 | m_opacsld-> setRange ( -20, 20 ); | 90 | m_opacsld-> setRange ( -20, 20 ); |
91 | m_opacsld-> setSteps ( 1, 1 ); | ||
91 | m_opacsld-> setValue ( opacity ); | 92 | m_opacsld-> setValue ( opacity ); |
92 | m_opacsld-> setTickmarks ( QSlider::Below ); | 93 | m_opacsld-> setTickmarks ( QSlider::Below ); |
93 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); | 94 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); |
94 | 95 | ||
95 | vbox-> addSpacing ( 4 ); | 96 | vbox-> addSpacing ( 4 ); |
96 | 97 | ||
97 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); | 98 | QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this ); |
98 | shadow-> setChecked ( m_shadow ); | 99 | shadow-> setChecked ( m_shadow ); |
99 | vbox-> addWidget ( shadow ); | 100 | vbox-> addWidget ( shadow ); |
100 | 101 | ||
101 | vbox-> addSpacing ( 4 ); | 102 | vbox-> addSpacing ( 4 ); |
102 | 103 | ||
103 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); | 104 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); |
104 | flattb-> setChecked ( m_flat ); | 105 | flattb-> setChecked ( m_flat ); |
105 | vbox-> addWidget ( flattb ); | 106 | vbox-> addWidget ( flattb ); |
106 | 107 | ||
107 | vbox-> addSpacing ( 4 ); | 108 | vbox-> addSpacing ( 4 ); |
108 | 109 | ||
109 | QHBoxLayout *hbox = new QHBoxLayout ( vbox ); | 110 | QHBoxLayout *hbox = new QHBoxLayout ( vbox ); |
110 | 111 | ||
111 | hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this )); | 112 | hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this )); |
112 | 113 | ||
113 | m_contsld = new QSlider ( Horizontal, this ); | 114 | m_contsld = new QSlider ( Horizontal, this ); |
114 | m_contsld-> setRange ( 0, 10 ); | 115 | m_contsld-> setRange ( 0, 10 ); |
116 | m_contsld-> setSteps ( 1, 1 ); | ||
115 | m_contsld-> setValue ( contrast ); | 117 | m_contsld-> setValue ( contrast ); |
116 | m_contsld-> setTickmarks ( QSlider::Below ); | 118 | m_contsld-> setTickmarks ( QSlider::Below ); |
117 | hbox-> addWidget ( m_contsld, 10 ); | 119 | hbox-> addWidget ( m_contsld, 10 ); |
118 | 120 | ||
119 | vbox-> addStretch ( 10 ); | 121 | vbox-> addStretch ( 10 ); |
120 | 122 | ||
121 | changeType ( m_type ); | 123 | changeType ( m_type ); |
122 | 124 | ||
123 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); | 125 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); |
124 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | 126 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); |
125 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); | 127 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); |
126 | } | 128 | } |
127 | 129 | ||
128 | void LiquidSettings::changeType ( int t ) | 130 | void LiquidSettings::changeType ( int t ) |
129 | { | 131 | { |
130 | bool custom = ( t == Custom ); | 132 | bool custom = ( t == Custom ); |
131 | 133 | ||
132 | m_menulbl-> setEnabled ( custom ); | 134 | m_menulbl-> setEnabled ( custom ); |
133 | m_textlbl-> setEnabled ( custom ); | 135 | m_textlbl-> setEnabled ( custom ); |
134 | m_opaclbl-> setEnabled ( custom ); | 136 | m_opaclbl-> setEnabled ( custom ); |
135 | m_menubtn-> setEnabled ( custom ); | 137 | m_menubtn-> setEnabled ( custom ); |
136 | m_textbtn-> setEnabled ( custom ); | 138 | m_textbtn-> setEnabled ( custom ); |
137 | m_opacsld-> setEnabled ( custom ); | 139 | m_opacsld-> setEnabled ( custom ); |
138 | 140 | ||
139 | m_type = t; | 141 | m_type = t; |
140 | } | 142 | } |
141 | 143 | ||
142 | void LiquidSettings::changeShadow ( bool b ) | 144 | void LiquidSettings::changeShadow ( bool b ) |
143 | { | 145 | { |
144 | m_shadow = b; | 146 | m_shadow = b; |
145 | } | 147 | } |
146 | 148 | ||
147 | void LiquidSettings::changeFlat ( bool b ) | 149 | void LiquidSettings::changeFlat ( bool b ) |
148 | { | 150 | { |
149 | m_flat = b; | 151 | m_flat = b; |
150 | } | 152 | } |
151 | 153 | ||
152 | 154 | ||
153 | bool LiquidSettings::writeConfig ( ) | 155 | bool LiquidSettings::writeConfig ( ) |
154 | { | 156 | { |
155 | Config config ( "qpe" ); | 157 | Config config ( "qpe" ); |
156 | config. setGroup ( "Liquid-Style" ); | 158 | config. setGroup ( "Liquid-Style" ); |
157 | 159 | ||
158 | config. writeEntry ( "Type", m_type ); | 160 | config. writeEntry ( "Type", m_type ); |
159 | config. writeEntry ( "Color", m_menubtn-> color ( ). name ( )); | 161 | config. writeEntry ( "Color", m_menubtn-> color ( ). name ( )); |
160 | config. writeEntry ( "TextColor", m_textbtn-> color ( ). name ( )); | 162 | config. writeEntry ( "TextColor", m_textbtn-> color ( ). name ( )); |
161 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); | 163 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); |
162 | config. writeEntry ( "ShadowText", m_shadow ); | 164 | config. writeEntry ( "ShadowText", m_shadow ); |