Enhancement: Fixes #339, Improvements for comctl default styles and CPLs

This commit is contained in:
Rory Fewell
2024-09-21 00:02:06 +01:00
parent 627bfee00c
commit 8164440186
15 changed files with 482 additions and 62 deletions

View File

@@ -11,6 +11,18 @@
*/
#define WINTC_CTL_BUTTON_BOX_CSS_CLASS "wintc-button-box"
#define WINTC_CTL_BUTTON_CSS_CLASS "wintc-button"
#define WINTC_CTL_MARGINB_MD_CSS_CLASS "wintc-mb-md"
#define WINTC_CTL_MARGINL_MD_CSS_CLASS "wintc-ml-md"
#define WINTC_CTL_MARGINR_MD_CSS_CLASS "wintc-mr-md"
#define WINTC_CTL_MARGINT_MD_CSS_CLASS "wintc-mt-md"
#define WINTC_CTL_MARGINB_LG_CSS_CLASS "wintc-mb-lg"
#define WINTC_CTL_MARGINL_LG_CSS_CLASS "wintc-ml-lg"
#define WINTC_CTL_MARGINR_LG_CSS_CLASS "wintc-mr-lg"
#define WINTC_CTL_MARGINT_LG_CSS_CLASS "wintc-mt-lg"
//
// PUBLIC FUNCTIONS
//

View File

@@ -1,11 +1,50 @@
box.wintc-button-box
/**
* Sizing metrics - these are standard classes to provide spacing for the
* Adwaita theme, to be overridden by the WinTC themes
*
* Default sizing¬
* md: 8px
* lg: 16px
*/
/** medium **/
.wintc-mb-md { margin-bottom: 8px; }
.wintc-ml-md { margin-left: 8px; }
.wintc-mr-md { margin-right: 8px; }
.wintc-mt-md { margin-top: 8px; }
/** large **/
.wintc-mb-lg { margin-bottom: 16px; }
.wintc-ml-lg { margin-left: 16px; }
.wintc-mr-lg { margin-right: 16px; }
.wintc-mt-lg { margin-top: 16px; }
box.horizontal.wintc-button-box button
{
margin: 0px 8px 10px;
margin: 0px 4px;
}
box.wintc-button-box button
box.horizontal.wintc-button-box button:first-child
{
margin-left: 8px;
min-height: 15px;
min-width: 51px;
margin-left: 0px;
}
box.horizontal.wintc-button-box button:last-child
{
margin-right: 0px;
}
box.vertical.wintc-button-box button
{
margin: 4px 0px;
}
box.vertical.wintc-button-box button:first-child
{
margin-top: 0px;
}
box.vertical.wintc-button-box button:last-child
{
margin-bottom: 0px;
}

View File

@@ -21,6 +21,8 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton" id="button-apply">
<property name="label" translatable="no">Apply</property>
@@ -68,6 +70,7 @@
</child>
<style>
<class name="wintc-button-box"/>
<class name="wintc-mt-md" />
</style>
</object>
<packing>
@@ -76,5 +79,11 @@
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
<class name="wintc-mt-md" />
</style>
</object>
</interface>

View File

@@ -43,6 +43,10 @@
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -68,6 +72,10 @@
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -113,17 +121,23 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">GTK_ALIGN_END</property>
<property name="orientation">vertical</property>
<property name="valign">2</property>
<property name="valign">GTK_ALIGN_END</property>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="halign">2</property>
<property name="halign">GTK_ALIGN_FILL</property>
<property name="label" translatable="yes">Effects...</property>
<property name="sensitive">False</property>
<style>
<class name="wintc-button" />
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -136,9 +150,13 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="halign">2</property>
<property name="halign">GTK_ALIGN_FILL</property>
<property name="label" translatable="yes">Advanced</property>
<property name="sensitive">False</property>
<style>
<class name="wintc-button" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -153,6 +171,13 @@
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-mb-lg" />
<class name="wintc-ml-lg" />
<class name="wintc-mr-lg" />
<class name="wintc-mt-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>

View File

@@ -40,8 +40,8 @@
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -52,6 +52,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Background:</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-ml-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -87,6 +91,10 @@
<property name="can-focus">True</property>
</object>
</child>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -101,6 +109,7 @@
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="yes">Customize Desktop...</property>
<property name="halign">GTK_ALIGN_START</property>
<property name="sensitive">False</property>
</object>
<packing>
@@ -109,6 +118,10 @@
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-mr-lg" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -131,6 +144,11 @@
<property name="receives-default">True</property>
<property name="label" translatable="yes">%PUNC_MOREINPUT%%CTL_BROWSE%</property>
<property name="sensitive">False</property>
<style>
<class name="wintc-button" />
<class name="wintc-mb-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -145,6 +163,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Position:</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -165,6 +187,10 @@
<attribute name="text">1</attribute>
</attributes>
</child>
<style>
<class name="wintc-mb-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -179,6 +205,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Color:</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -190,6 +220,10 @@
<object class="GtkColorButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<style>
<class name="wintc-button" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -204,6 +238,13 @@
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
<class name="wintc-ml-lg" />
<class name="wintc-mr-lg" />
<class name="wintc-mt-md" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -211,5 +252,9 @@
<property name="position">2</property>
</packing>
</child>
<style>
<class name="wintc-mt-lg" />
</style>
</object>
</interface>

View File

@@ -17,8 +17,8 @@
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -47,6 +47,11 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="sensitive">False</property>
<style>
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -55,12 +60,44 @@
</packing>
</child>
<child>
<object class="GtkButton">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="yes">Settings</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="yes">Settings</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="yes">Preview</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-button-box" />
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -68,20 +105,10 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="yes">Preview</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -102,6 +129,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Wait:</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-ml-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -114,6 +145,11 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="sensitive">False</property>
<style>
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -147,6 +183,10 @@
<property name="position">3</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -156,6 +196,10 @@
</child>
</object>
</child>
<style>
<class name="wintc-mt-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -180,9 +224,15 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">To adjust monitor power settings and save energy, click Power.</property>
<property name="max-width-chars">49</property>
<property name="halign">GTK_ALIGN_END</property>
<property name="max-width-chars">44</property>
<property name="wrap">True</property>
<property name="xalign">1.0</property>
<style>
<class name="wintc-mr-md" />
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -199,6 +249,12 @@
<property name="halign">2</property>
<property name="label" translatable="yes">Power</property>
<property name="sensitive">False</property>
<style>
<class name="wintc-button" />
<class name="wintc-mr-md" />
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -215,5 +271,12 @@
<property name="position">2</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
<class name="wintc-ml-lg" />
<class name="wintc-mr-lg" />
<class name="wintc-mt-lg" />
</style>
</object>
</interface>

View File

@@ -18,8 +18,8 @@
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -30,6 +30,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Display:</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-mt-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -43,6 +47,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">(not implemented)</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-mb-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -82,6 +90,11 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Less</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -106,6 +119,11 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">More</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -125,6 +143,10 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">blam! pixels</property>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -134,6 +156,10 @@
</child>
</object>
</child>
<style>
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -158,6 +184,11 @@
<object class="GtkComboBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<style>
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -169,6 +200,10 @@
<!-- TODO: Color graphic thing here -->
</object>
</child>
<style>
<class name="wintc-ml-md" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -183,5 +218,60 @@
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="homogeneous">True</property>
<property name="halign">GTK_ALIGN_END</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="true">Advanced</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="true">Troubleshoot...</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<style>
<class name="wintc-button-box" />
<class name="wintc-mt-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<style>
<class name="wintc-mb-lg" />
<class name="wintc-ml-lg" />
<class name="wintc-mr-lg" />
<class name="wintc-mt-lg" />
</style>
</object>
</interface>

View File

@@ -16,9 +16,14 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">A theme is a background plus a set of sounds, icons, and other elements to help you personalize your computer with one click.</property>
<property name="max-width-chars">71</property>
<property name="halign">GTK_ALIGN_START</property>
<property name="max-width-chars">58</property>
<property name="wrap">True</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-mb-lg" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -34,6 +39,10 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes">Theme:</property>
<property name="xalign">0.0</property>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -50,6 +59,9 @@
<child>
<object class="GtkComboBox">
<style>
<class name="wintc-mr-md" />
</style>
</object>
<packing>
<property name="expand">True</property>
@@ -59,12 +71,44 @@
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">%CTL_SAVEAS%</property>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">%CTL_SAVEAS%</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">%CTL_DELETE%</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-button-box" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -73,20 +117,9 @@
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">%CTL_DELETE%</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
</style>
</object>
<packing>
<property name="expand">False</property>
@@ -109,5 +142,12 @@
<property name="position">3</property>
</packing>
</child>
<style>
<class name="wintc-mb-lg" />
<class name="wintc-ml-lg" />
<class name="wintc-mr-lg" />
<class name="wintc-mt-lg" />
</style>
</object>
</interface>

View File

@@ -94,13 +94,13 @@ static void wintc_cpl_desk_window_init(
gtk_widget_set_size_request(
GTK_WIDGET(self),
414, // Approx.
454
402, // Approx.
420
);
gtk_window_set_default_size(
GTK_WINDOW(self),
414, // Approx.
454
402, // Approx.
420
);
gtk_window_set_icon_name(
GTK_WINDOW(self),

View File

@@ -21,6 +21,8 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton" id="button-apply">
<property name="label" translatable="yes">Apply</property>
@@ -68,6 +70,7 @@
</child>
<style>
<class name="wintc-button-box"/>
<class name="wintc-mt-md" />
</style>
</object>
<packing>
@@ -76,5 +79,12 @@
<property name="position">1</property>
</packing>
</child>
<style>
<class name="wintc-mb-md" />
<class name="wintc-ml-md" />
<class name="wintc-mr-md" />
<class name="wintc-mt-md" />
</style>
</object>
</interface>

View File

@@ -69,8 +69,13 @@ static void wintc_cpl_sysdm_window_init(
gtk_widget_set_size_request(
GTK_WIDGET(self),
414, // Approx.
454
402, // Approx.
420
);
gtk_window_set_default_size(
GTK_WINDOW(self),
402, // Approx.
420
);
gtk_window_set_resizable(
GTK_WINDOW(self),

View File

@@ -227,7 +227,7 @@ static void wintc_run_dialog_init(
//
// FIXME: This should not be done here, use screen CSS instead!
//
wintc_widget_add_css(box_buttons, "box { margin: 0px; }");
wintc_widget_add_css(box_buttons, "box { margin-bottom: 10px; }");
wintc_widget_add_css(box_outer, "box { margin: 18px 11px 0px; }");
wintc_widget_add_css(box_instructions, "box { margin-bottom: 13px; }");
wintc_widget_add_css(box_input, "box { margin-bottom: 34px; }");

View File

@@ -204,6 +204,14 @@ int main(
box_buttons,
WINTC_CTL_BUTTON_BOX_CSS_CLASS
);
wintc_widget_add_style_class(
box_buttons,
WINTC_CTL_MARGINB_LG_CSS_CLASS
);
wintc_widget_add_style_class(
box_buttons,
WINTC_CTL_MARGINR_LG_CSS_CLASS
);
// Clear mem
//

View File

@@ -7,6 +7,7 @@
* Authors: Rory Fewell <roryf@oddmatics.uk>
*/
@import "wintc-comctl";
@import "wintc-taskband";
@import "wintc-taskbuttons";
@import "xp-start-plugin";

View File

@@ -0,0 +1,73 @@
/**
* wintc-comctl.scss - Theme Base Common Control (comctl) Styles
*
* This source-code is part of Windows XP stuff for XFCE:
* <<https://www.oddmatics.uk>>
*
* Author(s): Rory Fewell <roryf@oddmatics.uk>
*/
$metric_md: 6px;
$metric_lg: 12px;
/** medium **/
.wintc-mb-md { margin-bottom: $metric_md; }
.wintc-ml-md { margin-left: $metric_md; }
.wintc-mr-md { margin-right: $metric_md; }
.wintc-mt-md { margin-top: $metric_md; }
/** large **/
.wintc-mb-lg { margin-bottom: $metric_lg; }
.wintc-ml-lg { margin-left: $metric_lg; }
.wintc-mr-lg { margin-right: $metric_lg; }
.wintc-mt-lg { margin-top: $metric_lg; }
.wintc-button
{
min-height: 15px;
min-width: 51px;
}
box.wintc-button-box
{
button
{
@extend .wintc-button;
}
&.horizontal
{
button
{
margin: 0px calc($metric_md / 2);
&:first-child
{
margin-left: 0px;
}
&:last-child
{
margin-right: 0px;
}
}
}
&:vertical
{
button
{
margin: calc($metric_md / 2) 0px;
&:first-child
{
margin-top: 0px;
}
&:last-child
{
margin-bottom: 0px;
}
}
}
}