|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Patch Review Request: CoverSwitch - custom mirror colorsEven if I set my screen to "headache bright" i can hardly see the reflections
Daylight or dark windows increase the problem. Therefore i'd like to be able to change them (i had just patched the values in the past ;-) Two-part patch. The config part adds new visible strings (and restructures the dialog) Cheers, Thomas [mirrorcolors.diff] Index: coverswitch.cpp =================================================================== --- coverswitch.cpp (Revision 1042756) +++ coverswitch.cpp (Arbeitskopie) @@ -92,6 +92,16 @@ timeLine.setDuration( animationDuration ); primaryTabBox = conf.readEntry( "TabBox", false ); secondaryTabBox = conf.readEntry( "TabBoxAlternative", false ); + QColor tmp = conf.readEntry( "MirrorFrontColor", QColor(0,0,0) ); + mirrorColor[0][0] = tmp.redF(); + mirrorColor[0][1] = tmp.greenF(); + mirrorColor[0][2] = tmp.blueF(); + mirrorColor[0][3] = 1.0; + tmp = conf.readEntry( "MirrorRearColor", QColor(0,0,0) ); + mirrorColor[1][0] = tmp.redF(); + mirrorColor[1][1] = tmp.greenF(); + mirrorColor[1][2] = tmp.blueF(); + mirrorColor[1][3] = -1.0; // thumbnail bar color_frame = KColorScheme( QPalette::Active, KColorScheme::Window ).background().color(); @@ -271,12 +281,12 @@ (float)area.width()*reflectionScaleFactor, area.height(), -5000, -(float)area.width()*reflectionScaleFactor, area.height(), -5000 }; // foreground - float alpha = 1.0; if( start ) - alpha = timeLine.value(); + mirrorColor[0][3] = timeLine.value(); else if( stop ) - alpha = 1.0 - timeLine.value(); - glColor4f( 0.0, 0.0, 0.0, alpha ); + mirrorColor[0][3] = 1.0 - timeLine.value(); + glColor4fv( mirrorColor[0] ); + mirrorColor[0][3] = 1.0; int y = 0; // have to adjust the y values to fit OpenGL @@ -299,8 +309,7 @@ glVertex3f( vertices[0], vertices[1], vertices[2] ); glVertex3f( vertices[3], vertices[4], vertices[5] ); // rearground - alpha = -1.0; - glColor4f( 0.0, 0.0, 0.0, alpha ); + glColor4fv( mirrorColor[1] ); glVertex3f( vertices[6], vertices[7], vertices[8] ); glVertex3f( vertices[9], vertices[10], vertices[11] ); glEnd(); Index: coverswitch.h =================================================================== --- coverswitch.h (Revision 1042756) +++ coverswitch.h (Arbeitskopie) @@ -77,6 +77,7 @@ bool start; bool stop; bool reflection; + float mirrorColor[2][4]; bool windowTitle; int animationDuration; bool stopRequested; [mirrorcolors_config.diff] Index: coverswitch_config.cpp =================================================================== --- coverswitch_config.cpp (Revision 1042756) +++ coverswitch_config.cpp (Arbeitskopie) @@ -47,6 +47,8 @@ connect(m_ui->checkAnimateStart, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->checkAnimateStop, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->checkReflection, SIGNAL(stateChanged(int)), this, SLOT(changed())); + connect(m_ui->colorFront, SIGNAL(changed(const QColor&)), this, SLOT(changed())); + connect(m_ui->colorRear, SIGNAL(changed(const QColor&)), this, SLOT(changed())); connect(m_ui->checkWindowTitle, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->checkThumbnails, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->checkDynamicThumbnails, SIGNAL(stateChanged(int)), this, SLOT(changed())); @@ -72,6 +74,8 @@ m_ui->checkAnimateStart->setChecked( conf.readEntry( "AnimateStart", true )); m_ui->checkAnimateStop->setChecked( conf.readEntry( "AnimateStop", true )); m_ui->checkReflection->setChecked( conf.readEntry( "Reflection", true )); + m_ui->colorFront->setColor( conf.readEntry( "MirrorFrontColor", QColor(0,0,0) )); + m_ui->colorRear->setColor( conf.readEntry( "MirrorRearColor", QColor(0,0,0) )); m_ui->checkWindowTitle->setChecked( conf.readEntry( "WindowTitle", true )); m_ui->checkThumbnails->setChecked( conf.readEntry( "Thumbnails", true )); m_ui->checkDynamicThumbnails->setChecked( conf.readEntry( "DynamicThumbnails", true )); @@ -92,6 +96,8 @@ conf.writeEntry( "AnimateStart", m_ui->checkAnimateStart->isChecked() ); conf.writeEntry( "AnimateStop", m_ui->checkAnimateStop->isChecked() ); conf.writeEntry( "Reflection", m_ui->checkReflection->isChecked() ); + conf.writeEntry( "MirrorFrontColor", m_ui->colorFront->color() ); + conf.writeEntry( "MirrorRearColor", m_ui->colorRear->color() ); conf.writeEntry( "WindowTitle", m_ui->checkWindowTitle->isChecked() ); conf.writeEntry( "Thumbnails", m_ui->checkThumbnails->isChecked() ); conf.writeEntry( "DynamicThumbnails", m_ui->checkDynamicThumbnails->isChecked() ); @@ -111,6 +117,8 @@ m_ui->checkAnimateStart->setCheckState( Qt::Checked ); m_ui->checkAnimateStop->setCheckState( Qt::Checked ); m_ui->checkReflection->setCheckState( Qt::Checked ); + m_ui->colorFront->setColor( QColor(0,0,0) ); + m_ui->colorRear->setColor( QColor(0,0,0) ); m_ui->checkWindowTitle->setCheckState( Qt::Checked ); m_ui->checkThumbnails->setCheckState( Qt::Checked ); m_ui->checkDynamicThumbnails->setCheckState( Qt::Checked ); Index: coverswitch_config.ui =================================================================== --- coverswitch_config.ui (Revision 1042756) +++ coverswitch_config.ui (Arbeitskopie) @@ -6,197 +6,257 @@ <rect> <x>0</x> <y>0</y> - <width>492</width> - <height>236</height> + <width>453</width> + <height>264</height> </rect> </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="1"> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>Zoom</string> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QCheckBox" name="checkWindowTitle"> + <property name="text"> + <string>Display window &titles</string> </property> - <layout class="QGridLayout" name="gridLayout_8"> - <item row="1" column="0"> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>Near</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="label_9"> - <property name="text"> - <string>Far</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="0" column="0" colspan="2"> - <widget class="QSlider" name="zPositionSlider"> - <property name="toolTip"> - <string>Define how far away the windows should appear</string> - </property> - <property name="maximum"> - <number>3000</number> - </property> - <property name="singleStep"> - <number>100</number> - </property> - <property name="pageStep"> - <number>500</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition"> - <enum>QSlider::TicksBelow</enum> - </property> - <property name="tickInterval"> - <number>200</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="groupBox_3"> - <property name="title"> - <string>Thumbnail Bar</string> + <property name="shortcut"> + <string/> </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0" colspan="2"> - <widget class="QCheckBox" name="checkThumbnails"> - <property name="text"> - <string>Use additional thumbnail bar</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="checkDynamicThumbnails"> - <property name="toolTip"> - <string>Only show thumbnail bar if there are at least specified number of windows</string> - </property> - <property name="text"> - <string>Dynamic mode</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="labelThumbnailWindows"> - <property name="text"> - <string>Number of windows:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy"> - <cstring>spinThumbnailWindows</cstring> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="KIntSpinBox" name="spinThumbnailWindows"/> - </item> - </layout> </widget> </item> - <item row="0" column="0" rowspan="3"> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Appearance</string> + <item> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Zoom</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="zPositionSlider"> + <property name="toolTip"> + <string>Define how far away the windows should appear</string> + </property> + <property name="maximum"> + <number>3000</number> + </property> + <property name="singleStep"> + <number>100</number> + </property> + <property name="pageStep"> + <number>500</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval"> + <number>200</number> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>Near</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_9"> + <property name="text"> + <string>Far</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QTabWidget" name="tabWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0" colspan="2"> - <widget class="QCheckBox" name="checkAnimateSwitch"> - <property name="text"> - <string>Animate switch</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="checkAnimateStart"> - <property name="text"> - <string>Animation on tab box open</string> - </property> - </widget> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QCheckBox" name="checkAnimateStop"> - <property name="text"> - <string>Animation on tab box close</string> - </property> - </widget> - </item> - <item row="3" column="0" colspan="2"> - <widget class="QCheckBox" name="checkReflection"> - <property name="text"> - <string>Reflections</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="KIntSpinBox" name="spinDuration"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="specialValueText"> - <string comment="Duration of rotation">Default</string> - </property> - <property name="maximum"> - <number>5000</number> - </property> - <property name="singleStep"> - <number>10</number> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Animation duration:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buddy"> - <cstring>spinDuration</cstring> - </property> - </widget> - </item> - <item row="6" column="0" colspan="2"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - <item row="4" column="0"> - <widget class="QCheckBox" name="checkWindowTitle"> - <property name="text"> - <string>Display window &titles</string> - </property> - <property name="shortcut"> - <string/> - </property> - </widget> - </item> - </layout> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="tab"> + <attribute name="title"> + <string>Animation</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QCheckBox" name="checkAnimateSwitch"> + <property name="text"> + <string>Animate switch</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkAnimateStart"> + <property name="text"> + <string>Animation on tab box open</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkAnimateStop"> + <property name="text"> + <string>Animation on tab box close</string> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Animation duration:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>spinDuration</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KIntSpinBox" name="spinDuration"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="specialValueText"> + <string comment="Duration of rotation">Default</string> + </property> + <property name="maximum"> + <number>5000</number> + </property> + <property name="singleStep"> + <number>10</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_2"> + <attribute name="title"> + <string>Thumbnail Bar</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="checkThumbnails"> + <property name="text"> + <string>Use additional thumbnail bar</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkDynamicThumbnails"> + <property name="toolTip"> + <string>Only show thumbnail bar if there are at least specified number of windows</string> + </property> + <property name="text"> + <string>Dynamic mode</string> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="labelThumbnailWindows"> + <property name="text"> + <string>Number of windows:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>spinThumbnailWindows</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KIntSpinBox" name="spinThumbnailWindows"/> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_3"> + <attribute name="title"> + <string>Reflections</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QCheckBox" name="checkReflection"> + <property name="text"> + <string>Reflections</string> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout_3"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::FieldsStayAtSizeHint</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Rear color</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KColorButton" name="colorRear"/> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Front color</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="KColorButton" name="colorFront"/> + </item> + </layout> + </item> + </layout> + </widget> </widget> </item> - <item row="2" column="1"> + <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -217,18 +277,125 @@ <extends>QSpinBox</extends> <header>knuminput.h</header> </customwidget> + <customwidget> + <class>KColorButton</class> + <extends>QPushButton</extends> + <header>kcolorbutton.h</header> + </customwidget> </customwidgets> - <tabstops> - <tabstop>checkAnimateSwitch</tabstop> - <tabstop>checkAnimateStart</tabstop> - <tabstop>checkAnimateStop</tabstop> - <tabstop>checkReflection</tabstop> - <tabstop>spinDuration</tabstop> - <tabstop>checkThumbnails</tabstop> - <tabstop>checkDynamicThumbnails</tabstop> - <tabstop>spinThumbnailWindows</tabstop> - <tabstop>zPositionSlider</tabstop> - </tabstops> <resources/> - <connections/> + <connections> + <connection> + <sender>checkReflection</sender> + <signal>toggled(bool)</signal> + <receiver>colorFront</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>60</x> + <y>49</y> + </hint> + <hint type="destinationlabel"> + <x>282</x> + <y>110</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkReflection</sender> + <signal>toggled(bool)</signal> + <receiver>colorRear</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>102</x> + <y>51</y> + </hint> + <hint type="destinationlabel"> + <x>284</x> + <y>72</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkReflection</sender> + <signal>toggled(bool)</signal> + <receiver>label_2</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>136</x> + <y>47</y> + </hint> + <hint type="destinationlabel"> + <x>202</x> + <y>78</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkReflection</sender> + <signal>toggled(bool)</signal> + <receiver>label</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>175</x> + <y>49</y> + </hint> + <hint type="destinationlabel"> + <x>209</x> + <y>102</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkThumbnails</sender> + <signal>toggled(bool)</signal> + <receiver>checkDynamicThumbnails</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>103</x> + <y>58</y> + </hint> + <hint type="destinationlabel"> + <x>107</x> + <y>74</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkThumbnails</sender> + <signal>toggled(bool)</signal> + <receiver>labelThumbnailWindows</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>181</x> + <y>53</y> + </hint> + <hint type="destinationlabel"> + <x>259</x> + <y>106</y> + </hint> + </hints> + </connection> + <connection> + <sender>checkThumbnails</sender> + <signal>toggled(bool)</signal> + <receiver>spinThumbnailWindows</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>132</x> + <y>47</y> + </hint> + <hint type="destinationlabel"> + <x>324</x> + <y>106</y> + </hint> + </hints> + </connection> + </connections> </ui> _______________________________________________ kwin mailing list kwin@... https://mail.kde.org/mailman/listinfo/kwin |
|
|
Re: Patch Review Request: CoverSwitch - custom mirror colorsAm Montag 09 November 2009 01:31:26 schrieb Thomas Lübking:
> Even if I set my screen to "headache bright" i can hardly see the > reflections Daylight or dark windows increase the problem. > Therefore i'd like to be able to change them (i had just patched the values > in the past ;-) I think that patch makes sense - please commit :-) (I have noticed that depending on the graphics card the reflection looks very different. it's nice that OpenGL is a standard :-( ) > > Two-part patch. > The config part adds new visible strings (and restructures the dialog) > > Cheers, > Thomas > _______________________________________________ kwin mailing list kwin@... https://mail.kde.org/mailman/listinfo/kwin |
|
|
Re: Patch Review Request: CoverSwitch - custom mirror colorsAm Thursday 12 November 2009 schrieb Martin Gräßlin:
> (I have noticed that depending on the graphics card the reflection looks > very different. it's nice that OpenGL is a standard :-( ) I initially intended to allow adjusting the alphas as well (though kde seems to lack a nice picker ;-) but worried about the negative alpha on the rear - what does that do? make DST more opaque =D _______________________________________________ kwin mailing list kwin@... https://mail.kde.org/mailman/listinfo/kwin |
| Free embeddable forum powered by Nabble | Forum Help |