Prelim: Replace power buttons with themes

This commit is contained in:
Rory Fewell
2022-10-08 00:38:24 +01:00
committed by Rory Fewell
parent d47da05720
commit 6c75cbd82d
17 changed files with 102 additions and 18 deletions

View File

@@ -229,17 +229,23 @@ static void create_logoffpane_structure(
{
GtkWidget* logoffpane_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
//
// These are a couple ordinary buttons, except we have an extra box before the
// label so that themes can add an icon
//
// The reason for not using the gtk-icon-theme here is because the themes need
// to be able to override the image, AND they need to provide a 'hot' graphic for
// when the buttons are hovered
//
// Log off button
//
GtkWidget* logoff_button = gtk_button_new();
GtkWidget* logoff_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* logoff_icon = gtk_image_new_from_icon_name(
"system-log-out",
GTK_ICON_SIZE_LARGE_TOOLBAR
);
GtkWidget* logoff_label = gtk_label_new(_("Log Off"));
GtkWidget* logoff_button = gtk_button_new();
GtkWidget* logoff_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* logoff_icon_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* logoff_label = gtk_label_new(_("Log Off"));
gtk_box_pack_start(GTK_BOX(logoff_box), logoff_icon, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(logoff_box), logoff_icon_box, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(logoff_box), logoff_label, FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(logoff_button), logoff_box);
@@ -255,17 +261,16 @@ static void create_logoffpane_structure(
_("Provides options for closing your programs and logging off, or for leaving your programs running and switching to another user.")
);
wintc_widget_add_style_class(logoff_icon_box, "logoff-icon");
// Shut down button
//
GtkWidget* shutdown_button = gtk_button_new();
GtkWidget* shutdown_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* shutdown_icon = gtk_image_new_from_icon_name(
"system-shutdown",
GTK_ICON_SIZE_LARGE_TOOLBAR
);
GtkWidget* shutdown_label = gtk_label_new(_("Turn Off Computer"));
GtkWidget* shutdown_button = gtk_button_new();
GtkWidget* shutdown_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* shutdown_icon_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* shutdown_label = gtk_label_new(_("Turn Off Computer"));
gtk_box_pack_start(GTK_BOX(shutdown_box), shutdown_icon, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(shutdown_box), shutdown_icon_box, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(shutdown_box), shutdown_label, FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(shutdown_button), shutdown_box);
@@ -281,6 +286,8 @@ static void create_logoffpane_structure(
_("Provides options for turning off or restarting your computer, or for activating Stand By or Hibernate modes.")
);
wintc_widget_add_style_class(shutdown_icon_box, "shutdown-icon");
// Pack box
//
gtk_box_pack_end(GTK_BOX(logoffpane_box), shutdown_button, FALSE, FALSE, 0);

View File

@@ -34,7 +34,12 @@ $start_menu_logoff_pane_styles: ();
$start_menu_button_styles: ();
$start_menu_button_hover_styles: ();
$start_menu_button_press_styles: ();
$start_menu_button_icon_styles: ();
$start_menu_button_icon_styles: ();
$start_menu_button_logoff_icon_styles: ();
$start_menu_button_logoff_icon_hover_styles: ();
$start_menu_button_shutdown_icon_styles: ();
$start_menu_button_shutdown_icon_hover_styles: ();
//
// START MENU PLACES COLUMN

View File

@@ -462,10 +462,39 @@ window.csd.xp-start-menu // Specificity hack -_-
@include __wintc_apply_props($start_menu_button_press_styles);
}
image
// Button icons
//
.logoff-icon,
.shutdown-icon
{
min-height: $start_menu_power_button_icon_size;
min-width: $start_menu_power_button_icon_size;
@include __wintc_apply_props($start_menu_button_icon_styles);
}
.logoff-icon
{
@include __wintc_apply_props($start_menu_button_logoff_icon_styles);
}
.shutdown-icon
{
@include __wintc_apply_props($start_menu_button_shutdown_icon_styles);
}
&:hover
{
.logoff-icon
{
@include __wintc_apply_props($start_menu_button_logoff_icon_hover_styles);
}
.shutdown-icon
{
@include __wintc_apply_props($start_menu_button_shutdown_icon_hover_styles);
}
}
}
}
}

View File

@@ -22,6 +22,8 @@ $start_menu_popup_menu_vmargin: 0px !default;
$start_menu_separator_thickness: $separator_thickness !default;
$start_menu_power_button_icon_size: 24px !default;
//
// START BUTTON
//
@@ -506,3 +508,44 @@ $start_menu_button_icon_styles:
undefined,
undefined
);
$start_menu_button_logoff_icon_styles:
wintc_define_props_bg(
$start_menu_button_logoff_icon_styles,
true,
undefined,
undefined,
undefined,
undefined,
url('../Resources/logoff_button.png')
);
$start_menu_button_logoff_icon_hover_styles:
wintc_define_props_bg(
$start_menu_button_logoff_icon_hover_styles,
true,
undefined,
undefined,
undefined,
undefined,
url('../Resources/logoff_button_hover.png')
);
$start_menu_button_shutdown_icon_styles:
wintc_define_props_bg(
$start_menu_button_shutdown_icon_styles,
true,
undefined,
undefined,
undefined,
undefined,
url('../Resources/shutdown_button.png')
);
$start_menu_button_shutdown_icon_hover_styles:
wintc_define_props_bg(
$start_menu_button_shutdown_icon_hover_styles,
true,
undefined,
undefined,
undefined,
undefined,
url('../Resources/shutdown_button_hover.png')
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB