25 #include "kdecoration_p.h" 27 #include <tdeconfig.h> 28 #include <tdeglobalsettings.h> 29 #include <tqpalette.h> 30 #include <tqapplication.h> 33 KDecorationOptionsPrivate::KDecorationOptionsPrivate()
35 for(
int i=0; i < NUM_COLORS*2; ++i)
39 KDecorationOptionsPrivate::~KDecorationOptionsPrivate()
42 for(i=0; i < NUM_COLORS*2; ++i)
52 void KDecorationOptionsPrivate::defaultKWinSettings()
54 title_buttons_left =
"MS";
55 title_buttons_right =
"HIAX";
56 custom_button_positions =
false;
59 cached_border_size = BordersCount;
60 move_resize_maximized_windows =
true;
61 OpMaxButtonRightClick = MaximizeOp;
62 OpMaxButtonMiddleClick = VMaximizeOp;
63 OpMaxButtonLeftClick = HMaximizeOp;
66 unsigned long KDecorationOptionsPrivate::updateKWinSettings( TDEConfig* config )
68 unsigned long changed = 0;
69 TQString old_group = config->group();
70 config->setGroup(
"WM" );
73 TQColor old_colors[NUM_COLORS*2];
77 old_colors[ i ] = colors[ i ];
79 TQPalette pal = TQApplication::palette();
81 colors[
ColorFrame] = pal.active().background();
87 if(TQPixmap::defaultDepth() > 8)
91 colors[
ColorButtonBg] = config->readColorEntry(
"activeTitleBtnBg",
94 colors[
ColorTitleBar] = config->readColorEntry(
"activeBackground",
96 if(TQPixmap::defaultDepth() > 8)
103 colors[
ColorFont] = pal.active().highlightedText();
107 colors[ColorFrame+NUM_COLORS] = config->readColorEntry(
"inactiveFrame",
108 &colors[ColorFrame]);
109 colors[ColorTitleBar+NUM_COLORS] = colors[
ColorFrame];
110 colors[ColorTitleBar+NUM_COLORS] = config->
111 readColorEntry(
"inactiveBackground", &colors[ColorTitleBar+NUM_COLORS]);
113 if(TQPixmap::defaultDepth() > 8)
114 colors[ColorTitleBlend+NUM_COLORS] = colors[ ColorTitleBar+NUM_COLORS ].dark(110);
116 colors[ColorTitleBlend+NUM_COLORS] = colors[ ColorTitleBar+NUM_COLORS ];
117 colors[ColorTitleBlend+NUM_COLORS] =
118 config->readColorEntry(
"inactiveBlend", &colors[ColorTitleBlend+NUM_COLORS]);
121 if(TQPixmap::defaultDepth() > 8)
122 colors[
ColorButtonBg+NUM_COLORS] = colors[ColorFrame+NUM_COLORS].light(130);
124 colors[
ColorButtonBg+NUM_COLORS] = colors[ColorFrame+NUM_COLORS];
126 config->readColorEntry(
"inactiveTitleBtnBg",
129 colors[ColorHandle+NUM_COLORS] =
130 config->readColorEntry(
"inactiveHandle", &colors[ColorHandle]);
132 colors[ColorFont+NUM_COLORS] = colors[
ColorFrame].dark();
133 colors[ColorFont+NUM_COLORS] = config->readColorEntry(
"inactiveForeground",
134 &colors[ColorFont+NUM_COLORS]);
139 if( old_colors[ i ] != colors[ i ] )
143 TQFont old_activeFont = activeFont;
144 TQFont old_inactiveFont = inactiveFont;
145 TQFont old_activeFontSmall = activeFontSmall;
146 TQFont old_inactiveFontSmall = inactiveFontSmall;
148 TQFont activeFontGuess = TDEGlobalSettings::windowTitleFont();
150 activeFont = config->readFontEntry(
"activeFont", &activeFontGuess);
151 inactiveFont = config->readFontEntry(
"inactiveFont", &activeFont);
153 activeFontSmall = activeFont;
154 activeFontSmall.setPointSize(activeFont.pointSize() - 2);
155 activeFontSmall = config->readFontEntry(
"activeFontSmall", &activeFontSmall);
156 inactiveFontSmall = config->readFontEntry(
"inactiveFontSmall", &activeFontSmall);
158 if( old_activeFont != activeFont
159 || old_inactiveFont != inactiveFont
160 || old_activeFontSmall != activeFontSmall
161 || old_inactiveFontSmall != inactiveFontSmall )
164 config->setGroup(
"Style" );
166 TQString old_title_buttons_left = title_buttons_left;
167 TQString old_title_buttons_right = title_buttons_right;
168 bool old_custom_button_positions = custom_button_positions;
169 custom_button_positions = config->readBoolEntry(
"CustomButtonPositions",
false);
170 if (custom_button_positions)
172 title_buttons_left = config->readEntry(
"ButtonsOnLeft",
"MS");
173 title_buttons_right = config->readEntry(
"ButtonsOnRight",
"HIAX");
177 title_buttons_left =
"MS";
178 title_buttons_right =
"HIAX";
180 if( old_custom_button_positions != custom_button_positions
181 || ( custom_button_positions &&
182 ( old_title_buttons_left != title_buttons_left
183 || old_title_buttons_right != title_buttons_right )))
187 bool old_show_tooltips = show_tooltips;
188 show_tooltips = config->readBoolEntry(
"ShowToolTips",
true);
189 if( old_show_tooltips != show_tooltips )
195 int border_size_num = config->readNumEntry(
"BorderSize",
BorderNormal );
196 if( border_size_num >= 0 && border_size_num < BordersCount )
197 border_size =
static_cast< BorderSize >( border_size_num );
200 if( old_border_size != border_size )
202 cached_border_size = BordersCount;
204 config->setGroup(
"Windows" );
205 bool old_move_resize_maximized_windows = move_resize_maximized_windows;
206 move_resize_maximized_windows = config->readBoolEntry(
"MoveResizeMaximizedWindows",
false );
207 if( old_move_resize_maximized_windows != move_resize_maximized_windows )
212 for(i=0; i < NUM_COLORS*2; ++i)
221 config->setGroup( old_group );
227 TQValueList< BorderSize > sizes )
const 229 for( TQValueList< BorderSize >::ConstIterator it = sizes.begin();
The color for the titlebar.
The tooltip setting was changed.
The color for the window frame (border)
The titlebar font was changed.
The color palette was changed.
The color to use for the titlebar buttons.
The blend color for the titlebar.
The color for the resize handle.
The button layout was changed.
Standard size borders, the default setting.
The border size setting was changed.