Remove primary_monitor_first and add primary as a possible monitor value (issue #614)
This commit is contained in:
@@ -31,7 +31,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, *panel_shrink;
|
||||
GtkWidget *panel_shrink;
|
||||
|
||||
GtkListStore *panel_items, *all_items;
|
||||
GtkWidget *panel_items_view, *all_items_view;
|
||||
@@ -477,6 +477,7 @@ void create_panel(GtkWidget *parent)
|
||||
gtk_table_attach(GTK_TABLE(table), panel_combo_monitor, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("All"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("Primary"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("1"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("2"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("3"));
|
||||
@@ -486,24 +487,6 @@ void create_panel(GtkWidget *parent)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 0);
|
||||
gtk_tooltips_set_tip(tooltips, panel_combo_monitor, _("The monitor on which the panel is placed"), NULL);
|
||||
|
||||
row++;
|
||||
col = 2;
|
||||
label = gtk_label_new(_("Primary monitor first"));
|
||||
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_primary_monitor_first = gtk_check_button_new();
|
||||
gtk_widget_show(panel_primary_monitor_first);
|
||||
gtk_table_attach(GTK_TABLE(table), panel_primary_monitor_first, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips,
|
||||
panel_primary_monitor_first,
|
||||
_("If enabled, the primary monitor will have index 1 in the monitor list even if it is not "
|
||||
"top-left."),
|
||||
NULL);
|
||||
|
||||
row++;
|
||||
col = 2;
|
||||
label = gtk_label_new(_("Length"));
|
||||
@@ -5169,6 +5152,7 @@ void create_systemtray(GtkWidget *parent)
|
||||
gtk_widget_show(systray_monitor);
|
||||
gtk_table_attach(GTK_TABLE(table), systray_monitor, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("Primary"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("1"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("2"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("3"));
|
||||
|
||||
@@ -19,7 +19,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, *panel_shrink;
|
||||
extern GtkWidget *panel_shrink;
|
||||
|
||||
enum { itemsColName = 0, itemsColValue, itemsNumCols };
|
||||
extern GtkListStore *panel_items, *all_items;
|
||||
|
||||
@@ -326,17 +326,15 @@ void config_write_panel(FILE *fp)
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(fp, "panel_monitor = ");
|
||||
if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor)) == 0) {
|
||||
if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor)) <= 0) {
|
||||
fprintf(fp, "all");
|
||||
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor)) == 1) {
|
||||
fprintf(fp, "primary");
|
||||
} else {
|
||||
fprintf(fp, "%d", gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor)));
|
||||
fprintf(fp, "%d", gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor)) - 1);
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(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);
|
||||
@@ -632,7 +630,11 @@ void config_write_systray(FILE *fp)
|
||||
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_brightness)));
|
||||
|
||||
fprintf(fp, "systray_monitor = ");
|
||||
fprintf(fp, "%d", MAX(1, 1 + gtk_combo_box_get_active(GTK_COMBO_BOX(systray_monitor))));
|
||||
if (gtk_combo_box_get_active(GTK_COMBO_BOX(systray_monitor)) <= 0) {
|
||||
fprintf(fp, "primary");
|
||||
} else {
|
||||
fprintf(fp, "%d", MAX(1, gtk_combo_box_get_active(GTK_COMBO_BOX(systray_monitor))));
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(fp, "systray_name_filter = %s\n", gtk_entry_get_text(GTK_ENTRY(systray_name_filter)));
|
||||
@@ -1357,20 +1359,20 @@ void add_entry(char *key, char *value)
|
||||
} else if (strcmp(key, "panel_monitor") == 0) {
|
||||
if (strcmp(value, "all") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 0);
|
||||
else if (strcmp(value, "1") == 0)
|
||||
else if (strcmp(value, "primary") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 1);
|
||||
else if (strcmp(value, "2") == 0)
|
||||
else if (strcmp(value, "1") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 2);
|
||||
else if (strcmp(value, "3") == 0)
|
||||
else if (strcmp(value, "2") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 3);
|
||||
else if (strcmp(value, "4") == 0)
|
||||
else if (strcmp(value, "3") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 4);
|
||||
else if (strcmp(value, "5") == 0)
|
||||
else if (strcmp(value, "4") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 5);
|
||||
else if (strcmp(value, "6") == 0)
|
||||
else if (strcmp(value, "5") == 0)
|
||||
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(value, "6") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 7);
|
||||
} else if (strcmp(key, "panel_shrink") == 0) {
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_shrink), atoi(value));
|
||||
}
|
||||
@@ -1761,18 +1763,20 @@ void add_entry(char *key, char *value)
|
||||
} else if (strcmp(key, "systray_icon_size") == 0) {
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_size), atoi(value));
|
||||
} else if (strcmp(key, "systray_monitor") == 0) {
|
||||
if (strcmp(value, "1") == 0)
|
||||
if (strcmp(value, "primary") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 0);
|
||||
else if (strcmp(value, "2") == 0)
|
||||
else if (strcmp(value, "1") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 1);
|
||||
else if (strcmp(value, "3") == 0)
|
||||
else if (strcmp(value, "2") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 2);
|
||||
else if (strcmp(value, "4") == 0)
|
||||
else if (strcmp(value, "3") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 3);
|
||||
else if (strcmp(value, "5") == 0)
|
||||
else if (strcmp(value, "4") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 4);
|
||||
else if (strcmp(value, "6") == 0)
|
||||
else if (strcmp(value, "5") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 5);
|
||||
else if (strcmp(value, "6") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 6);
|
||||
} else if (strcmp(key, "systray_icon_asb") == 0) {
|
||||
extract_values(value, &value1, &value2, &value3);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_opacity), atoi(value1));
|
||||
|
||||
Reference in New Issue
Block a user