Index: trunk/doc/conf/tree/appearance.html =================================================================== --- trunk/doc/conf/tree/appearance.html (revision 21421) +++ trunk/doc/conf/tree/appearance.html (revision 21422) @@ -3,6 +3,7 @@

subtree: appearance

node name type flags description +
compact boolean 0 when set: optimize GUI widget arrangement for small screen; may be wasting some screen space on large screen
rat_thickness coord 0
mark_size coord 0 relative marker size
layer_alpha real 0 alpha value for layer drawing Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 21421) +++ trunk/src/conf_core.h (revision 21422) @@ -166,6 +166,7 @@ /* @path appearance/color */ const struct appearance { + CFT_BOOLEAN compact; /* when set: optimize GUI widget arrangement for small screen; may be wasting some screen space on large screen */ CFT_COORD rat_thickness; CFT_COORD mark_size; /* relative marker size */ CFT_REAL layer_alpha; /* alpha value for layer drawing */ Index: trunk/src/pcb-conf.lht =================================================================== --- trunk/src/pcb-conf.lht (revision 21421) +++ trunk/src/pcb-conf.lht (revision 21422) @@ -134,6 +134,7 @@ } # design ha:appearance { + compact = 1 rat_thickness = 0.25 mm mark_size = 50 mil layer_alpha = 0.7 Index: trunk/src_plugins/dialogs/dlg_pref_general.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_general.c (revision 21421) +++ trunk/src_plugins/dialogs/dlg_pref_general.c (revision 21422) @@ -29,8 +29,7 @@ #include "dlg_pref.h" static pref_confitem_t perf_topwin[] = { - {"Alternate window layout to\nallow smaller horizontal size", "plugins/hid_gtk/compact_horizontal", 0, NULL}, - {"Alternate window layout to\nallow smaller vertical size", "plugins/hid_gtk/compact_vertical", 0, NULL}, + {"Alternate window layout to\nallow smaller size", "appearance/compact", 0, NULL}, {NULL, NULL, 0} }; Index: trunk/src_plugins/lib_gtk_common/bu_cursor_pos.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_cursor_pos.c (revision 21421) +++ trunk/src_plugins/lib_gtk_common/bu_cursor_pos.c (revision 21422) @@ -123,10 +123,10 @@ gtk_label_set_markup(GTK_LABEL(cps->cursor_position_relative_label), text ? text : ""); } -void ghid_set_cursor_position_labels(pcb_gtk_cursor_pos_t *cps, int compact_vertical) +void ghid_set_cursor_position_labels(pcb_gtk_cursor_pos_t *cps, int compact) { char *text, sep = ' '; - if (compact_vertical) + if (compact) sep = '\n'; if (pcb_marked.status) { Index: trunk/src_plugins/lib_gtk_common/bu_cursor_pos.h =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_cursor_pos.h (revision 21421) +++ trunk/src_plugins/lib_gtk_common/bu_cursor_pos.h (revision 21422) @@ -14,6 +14,6 @@ void make_cursor_position_labels(GtkWidget *hbox, pcb_gtk_cursor_pos_t *cps); /* update the content of the cursor pos labels */ -void ghid_set_cursor_position_labels(pcb_gtk_cursor_pos_t *cps, int compact_vertical); +void ghid_set_cursor_position_labels(pcb_gtk_cursor_pos_t *cps, int compact); #endif Index: trunk/src_plugins/lib_gtk_common/bu_mode_btn.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_mode_btn.c (revision 21421) +++ trunk/src_plugins/lib_gtk_common/bu_mode_btn.c (revision 21422) @@ -130,14 +130,8 @@ void pcb_gtk_pack_mode_buttons(pcb_gtk_mode_btn_t *mb) { - if (conf_hid_gtk.plugins.hid_gtk.compact_vertical) { - gtk_widget_hide(mb->mode_buttons_frame); - gtk_widget_show_all(mb->mode_toolbar); - } - else { - gtk_widget_hide(mb->mode_toolbar); - gtk_widget_show_all(mb->mode_buttons_frame); - } + gtk_widget_hide(mb->mode_buttons_frame); + gtk_widget_show_all(mb->mode_toolbar); } void pcb_gtk_make_mode_buttons_and_toolbar(pcb_gtk_common_t *com, pcb_gtk_mode_btn_t *mb) Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 21421) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 21422) @@ -111,7 +111,7 @@ void ghid_handle_units_changed(pcb_gtk_topwin_t *tw) { char *text = pcb_strdup_printf("%s", conf_core.editor.grid_unit->in_suffix); - ghid_set_cursor_position_labels(&tw->cps, conf_hid_gtk.plugins.hid_gtk.compact_vertical); + ghid_set_cursor_position_labels(&tw->cps, conf_core.appearance.compact); gtk_label_set_markup(GTK_LABEL(tw->cps.grid_units_label), text); free(text); ghid_config_handle_units_changed(tw->com); Index: trunk/src_plugins/lib_gtk_common/ui_crosshair.c =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_crosshair.c (revision 21421) +++ trunk/src_plugins/lib_gtk_common/ui_crosshair.c (revision 21422) @@ -35,6 +35,7 @@ #include "../src_plugins/lib_gtk_config/hid_gtk_conf.h" #include "ui_zoompan.h" #include "bu_cursor_pos.h" +#include "conf_core.h" void pcb_gtk_crosshair_set(pcb_coord_t x, pcb_coord_t y, int action, int offset_x, int offset_y, pcb_gtk_cursor_pos_t *cps, pcb_gtk_view_t *view) { @@ -45,7 +46,7 @@ pcb_coord_t pcb_x, pcb_y; if (view->crosshair_x != x || view->crosshair_y != y) { - ghid_set_cursor_position_labels(cps, conf_hid_gtk.plugins.hid_gtk.compact_vertical); + ghid_set_cursor_position_labels(cps, conf_core.appearance.compact); view->crosshair_x = x; view->crosshair_y = y; Index: trunk/src_plugins/lib_gtk_config/gui-config.c =================================================================== --- trunk/src_plugins/lib_gtk_config/gui-config.c (revision 21421) +++ trunk/src_plugins/lib_gtk_config/gui-config.c (revision 21422) @@ -412,22 +412,14 @@ /* -------------- The General config page ---------------- */ -static void config_compact_horizontal_toggle_cb(GtkToggleButton * button, gpointer data) +static void config_compact_toggle_cb(GtkToggleButton * button, gpointer data) { pcb_gtk_common_t *com = data; gboolean active = gtk_toggle_button_get_active(button); - conf_setf(CFR_DESIGN, "plugins/hid_gtk/compact_horizontal", -1, "%d", active); + conf_setf(CFR_DESIGN, "appearance/compact", -1, "%d", active); } -static void config_compact_vertical_toggle_cb(GtkToggleButton * button, gpointer data) -{ - pcb_gtk_common_t *com = data; - gboolean active = gtk_toggle_button_get_active(button); - - conf_setf(CFR_DESIGN, "plugins/hid_gtk/compact_vertical", -1, "%d", active); -} - static GtkWidget *pref_auto_place_lab; static void pref_auto_place_update(void) { @@ -472,8 +464,7 @@ void config_general_save(GtkButton * widget, save_ctx_t * ctx) { const char *paths[] = { - "plugins/hid_gtk/compact_horizontal", - "plugins/hid_gtk/compact_vertical", + "appearance/compact", "plugins/hid_gtk/history_size", "rc/backup_interval", "editor/auto_place", @@ -494,16 +485,11 @@ vbox = ghid_category_vbox(content_vbox, _("Enables"), 4, 2, TRUE, TRUE); - pcb_gtk_check_button_connected(vbox, NULL, conf_hid_gtk.plugins.hid_gtk.compact_horizontal, + pcb_gtk_check_button_connected(vbox, NULL, conf_core.appearance.compact, TRUE, FALSE, FALSE, 2, - config_compact_horizontal_toggle_cb, com, - _("Alternate window layout to allow smaller horizontal size")); + config_compact_toggle_cb, com, + _("Alternate window layout to allow smaller window size")); - pcb_gtk_check_button_connected(vbox, NULL, conf_hid_gtk.plugins.hid_gtk.compact_vertical, - TRUE, FALSE, FALSE, 2, - config_compact_vertical_toggle_cb, com, - _("Alternate window layout to allow smaller vertical size")); - pcb_gtk_check_button_connected(vbox, NULL, conf_core.editor.auto_place, TRUE, FALSE, FALSE, 2, config_auto_place_toggle_cb, NULL, Index: trunk/src_plugins/lib_gtk_config/hid_gtk_conf.h =================================================================== --- trunk/src_plugins/lib_gtk_config/hid_gtk_conf.h (revision 21421) +++ trunk/src_plugins/lib_gtk_config/hid_gtk_conf.h (revision 21422) @@ -9,8 +9,8 @@ CFT_BOOLEAN listen; /* @usage Listen for actions on stdin. */ CFT_STRING bg_image; /* @usage File name of an image to put into the background of the GUI canvas. The image is read via GdkPixbuf library. It can be any size, and will be automatically scaled to fit the canvas. */ - CFT_BOOLEAN compact_horizontal; - CFT_BOOLEAN compact_vertical; + CFT_BOOLEAN compact_horizontal; /* OBSOLETE: ignored; use central appearance/compact instead */ + CFT_BOOLEAN compact_vertical; /* OBSOLETE: ignored; use central appearance/compact instead */ CFT_INTEGER history_size; CFT_INTEGER n_mode_button_columns; Index: trunk/src_plugins/lib_gtk_hid/common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/common.c (revision 21421) +++ trunk/src_plugins/lib_gtk_hid/common.c (revision 21422) @@ -1,6 +1,7 @@ #include "config.h" #include "crosshair.h" +#include "conf_core.h" #include "gui.h" #include "common.h" @@ -43,7 +44,7 @@ pcb_gtk_coords_event2pcb(&gport->view, event_x, event_y, &gport->view.pcb_x, &gport->view.pcb_y); pcb_event_move_crosshair(gport->view.pcb_x, gport->view.pcb_y); - ghid_set_cursor_position_labels(&ghidgui->topwin.cps, conf_hid_gtk.plugins.hid_gtk.compact_vertical); + ghid_set_cursor_position_labels(&ghidgui->topwin.cps, conf_core.appearance.compact); } static void kbd_input_signals_connect(int idx, void *obj) Index: trunk/src_plugins/lib_gtk_hid/glue_common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 21421) +++ trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 21422) @@ -7,6 +7,7 @@ #include "gui.h" #include "render.h" #include "common.h" +#include "conf_core.h" #include "../src_plugins/lib_gtk_common/bu_status_line.h" #include "../src_plugins/lib_gtk_common/dlg_topwin.h" #include "../src_plugins/lib_gtk_config/hid_gtk_conf.h" @@ -24,7 +25,7 @@ static void ghid_set_status_line_label(void) { if (!ghidgui->topwin.cmd.command_entry_status_line_active) - pcb_gtk_status_line_update(ghidgui->topwin.status_line_label, conf_hid_gtk.plugins.hid_gtk.compact_horizontal); + pcb_gtk_status_line_update(ghidgui->topwin.status_line_label, conf_core.appearance.compact); } void ghid_status_line_set_text(const gchar *text) Index: trunk/src_plugins/lib_gtk_hid/glue_conf.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_conf.c (revision 21421) +++ trunk/src_plugins/lib_gtk_hid/glue_conf.c (revision 21422) @@ -71,7 +71,7 @@ ghidgui->common.set_status_line_label(); } -static void ghid_confchg_compacth(conf_native_t *cfg, int arr_idx) +static void ghid_confchg_compact(conf_native_t *cfg, int arr_idx) { /* test if PCB struct doesn't exist at startup */ if ((PCB == NULL) || !ghidgui->hid_active) @@ -81,16 +81,6 @@ ghidgui->common.set_status_line_label(); } -static void ghid_confchg_compactv(conf_native_t *cfg, int arr_idx) -{ - /* test if PCB struct doesn't exist at startup */ - if ((PCB == NULL) || !ghidgui->hid_active) - return; - - ghid_command_update_prompt(&ghidgui->topwin.cmd); - ghidgui->common.pack_mode_buttons(); -} - static void ghid_confchg_cli(conf_native_t *cfg, int arr_idx) { ghid_command_update_prompt(&ghidgui->topwin.cmd); @@ -134,6 +124,5 @@ init_conf_watch(&cbs_cli[0], "rc/cli_prompt", ghid_confchg_cli); init_conf_watch(&cbs_cli[1], "rc/cli_backend", ghid_confchg_cli); - init_conf_watch(&cbs_compacth, "plugins/hid_gtk/compact_horizontal", ghid_confchg_compacth); - init_conf_watch(&cbs_compactv, "plugins/hid_gtk/compact_vertical", ghid_confchg_compactv); + init_conf_watch(&cbs_compacth, "appearance/compact", ghid_confchg_compact); }