Add option to shrink panel (fixes issue #333)

This commit is contained in:
o9000
2016-10-08 14:45:00 +02:00
parent 8c7f4cc825
commit 61a80b996f
17 changed files with 636 additions and 267 deletions

View File

@@ -40,7 +40,7 @@ GtkWidget *panel_window_name, *disable_transparency;
GtkWidget *panel_mouse_effects;
GtkWidget *mouse_hover_icon_opacity, *mouse_hover_icon_saturation, *mouse_hover_icon_brightness;
GtkWidget *mouse_pressed_icon_opacity, *mouse_pressed_icon_saturation, *mouse_pressed_icon_brightness;
GtkWidget *panel_primary_monitor_first;
GtkWidget *panel_primary_monitor_first, *panel_shrink;
GtkListStore *panel_items, *all_items;
GtkWidget *panel_items_view, *all_items_view;
@@ -1385,6 +1385,19 @@ void create_panel(GtkWidget *parent)
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 0);
gtk_tooltips_set_tip(tooltips, panel_combo_width_type, _("The units used to specify the length of the panel: pixels or percentage of the monitor size"), NULL);
row++;
col = 2;
label = gtk_label_new(_("Shrink"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
panel_shrink = gtk_check_button_new();
gtk_widget_show(panel_shrink);
gtk_table_attach(GTK_TABLE(table), panel_shrink, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
row++;
col = 2;
label = gtk_label_new(_("Size"));

View File

@@ -17,7 +17,7 @@ extern GtkWidget *panel_window_name, *disable_transparency;
extern GtkWidget *panel_mouse_effects;
extern GtkWidget *mouse_hover_icon_opacity, *mouse_hover_icon_saturation, *mouse_hover_icon_brightness;
extern GtkWidget *mouse_pressed_icon_opacity, *mouse_pressed_icon_saturation, *mouse_pressed_icon_brightness;
extern GtkWidget *panel_primary_monitor_first;
extern GtkWidget *panel_primary_monitor_first, *panel_shrink;
enum {
itemsColName = 0,

View File

@@ -274,6 +274,10 @@ void config_write_panel(FILE *fp)
"primary_monitor_first = %d\n",
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_primary_monitor_first)) ? 1 : 0);
fprintf(fp,
"panel_shrink = %d\n",
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_shrink)) ? 1 : 0);
fprintf(fp, "autohide = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_autohide)) ? 1 : 0);
fprintf(fp, "autohide_show_timeout = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_autohide_show_time)));
fprintf(fp, "autohide_hide_timeout = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_autohide_hide_time)));
@@ -1196,6 +1200,8 @@ void add_entry(char *key, char *value)
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 6);
} else if (strcmp(key, "primary_monitor_first") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_primary_monitor_first), atoi(value));
} else if (strcmp(key, "primary_shrink") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_shrink), atoi(value));
}
/* autohide options */