Browse Source

Remove old style and switcher minibuttons

(Old svn revision: 3512)
upstream/xfce4-panel-4.10.1
Jasper Huijsmans 20 years ago
parent
commit
67fd337c40
  1. 28
      ChangeLog
  2. 2
      configure
  3. 9
      panel/controls.c
  4. 2
      panel/controls.h
  5. 5
      panel/global.h
  6. 14
      panel/groups.c
  7. 1
      panel/groups.h
  8. 10
      panel/handle.c
  9. 2
      panel/handle.h
  10. 1
      panel/mcs_client.c
  11. 44
      panel/panel.c
  12. 1
      panel/panel.h
  13. 21
      panel/popup.c
  14. 1
      panel/popup.h
  15. 357
      plugins/switcher/switcher.c
  16. 17
      plugins/systembuttons/systembuttons.c
  17. 2
      settings/xfce_settings.h
  18. 88
      settings/xfce_settings_dialog.c
  19. 5
      settings/xfce_settings_plugin.c

28
ChangeLog

@ -1,3 +1,31 @@
2003-01-26 19:33 huysmans
* configure.ac, po/fi.gmo, po/fi.po: Add Finnish translations
2003-01-25 22:26 huysmans
* panel/controls_dialog.c: Don't ask for removal confirmation for
controls without popup menu
2003-01-25 19:30 huysmans
* plugins/systembuttons/systembuttons.c: Add orientation to
systembuttons
2003-01-25 14:14 huysmans
* po/: de.gmo, de.po: Really add german translation
2003-01-25 14:12 huysmans
* configure, configure.ac: Add german translation
2003-01-25 13:24 huysmans
* ChangeLog, plugins/clock/clock.c, plugins/switcher/switcher.c,
plugins/systembuttons/systembuttons.c: Hide popup for clock and
systembuttons
2003-01-24 16:18 xfce
* plugins/clock/Makefile.am, plugins/clock/Makefile.in,

2
configure

@ -1876,7 +1876,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
ALL_LINGUAS="nl es fr de"
ALL_LINGUAS="nl es fr de fi"
rm -f .deps 2>/dev/null
mkdir .deps 2>/dev/null
if test -d .deps; then

9
panel/controls.c

@ -583,7 +583,6 @@ void control_set_settings(Control * control)
{
control_set_orientation(control, settings.orientation);
control_set_size(control, settings.size);
control_set_style(control, settings.style);
control_set_theme(control, settings.theme);
}
@ -608,14 +607,6 @@ void control_set_size(Control * control, int size)
}
}
void control_set_style(Control * control, int style)
{
ControlClass *cc = control->cclass;
if (cc && cc->set_style)
cc->set_style(control, style);
}
void control_set_theme(Control * control, const char *theme)
{
ControlClass *cc = control->cclass;

2
panel/controls.h

@ -52,7 +52,6 @@ struct _ControlClass
/* global preferences */
void (*set_orientation) (Control * control, int orientation);
void (*set_size) (Control * control, int size);
void (*set_style) (Control * control, int style);
void (*set_theme) (Control * control, const char *theme);
};
@ -98,7 +97,6 @@ void control_set_settings(Control * control);
void control_set_orientation(Control * control, int orientation);
void control_set_size(Control * control, int size);
void control_set_style(Control * control, int style);
void control_set_theme(Control * control, const char *theme);
#endif /* __XFCE_CONTROLS_H__ */

5
panel/global.h

@ -64,10 +64,6 @@
enum
{ LEFT, RIGHT, TOP, BOTTOM };
/* panel styles */
enum
{ OLD_STYLE, NEW_STYLE };
/* panel orientation */
enum
{ HORIZONTAL, VERTICAL };
@ -134,7 +130,6 @@ struct _Settings
int size;
int popup_position;
int style;
char *theme;
int num_groups;

14
panel/groups.c

@ -488,20 +488,6 @@ void groups_set_popup_position(int position)
}
}
void groups_set_style(int style)
{
GList *li;
PanelGroup *group;
for(li = group_list; li; li = li->next)
{
group = li->data;
panel_popup_set_style(group->popup, style);
control_set_style(group->control, style);
}
}
void groups_set_theme(const char *theme)
{
GList *li;

1
panel/groups.h

@ -44,7 +44,6 @@ void groups_set_layer(int layer);
void groups_set_size(int size);
void groups_set_popup_position(int position);
void groups_set_style(int style);
void groups_set_theme(const char *theme);
void groups_set_num_groups(int n);

10
panel/handle.c

@ -206,16 +206,6 @@ void handle_set_size(Handle * mh, int size)
/* gtk_widget_set_size_request(mh->button, h, h);*/
}
void handle_set_style(Handle * mh, int style)
{
#if 0
if(style == OLD_STYLE)
gtk_button_set_relief(GTK_BUTTON(mh->button), GTK_RELIEF_NORMAL);
else
gtk_button_set_relief(GTK_BUTTON(mh->button), GTK_RELIEF_NONE);
#endif
}
void handle_set_popup_position(Handle *mh)
{
handle_arrange(mh);

2
panel/handle.h

@ -32,8 +32,6 @@ void handle_unpack(Handle *mh, GtkContainer *container);
void handle_set_size(Handle *mh, int size);
void handle_set_style(Handle *mh, int style);
void handle_set_popup_position(Handle *mh);
#endif /* __XFCE_HANDLE_H__ */

1
panel/mcs_client.c

@ -91,7 +91,6 @@ static gpointer settings_callbacks [] = {
panel_set_layer,
panel_set_size,
panel_set_popup_position,
panel_set_style,
panel_set_theme,
/* panel_set_num_groups,*/
mcs_position_setting

44
panel/panel.c

@ -274,18 +274,6 @@ void panel_set_popup_position(int position)
panel_set_size(settings.size);
}
void panel_set_style(int style)
{
settings.style = style;
if (!panel_created)
return;
groups_set_style(style);
handle_set_style(handles[LEFT], style);
handle_set_style(handles[RIGHT], style);
}
void panel_set_theme(const char *theme)
{
g_free(settings.theme);
@ -314,7 +302,6 @@ void panel_set_settings(void)
panel_set_size(settings.size);
panel_set_popup_position(settings.popup_position);
panel_set_style(settings.style);
panel_set_theme(settings.theme);
panel_set_num_groups(settings.num_groups);
@ -409,7 +396,6 @@ static void init_settings(void)
settings.size = SMALL;
settings.popup_position = RIGHT;
settings.style = NEW_STYLE;
settings.theme = NULL;
@ -459,13 +445,6 @@ void panel_parse_xml(xmlNodePtr node)
g_free(value);
}
value = xmlGetProp(node, (const xmlChar *)"style");
if(value)
settings.style = atoi(value);
g_free(value);
value = xmlGetProp(node, (const xmlChar *)"icontheme");
if(value)
@ -550,32 +529,12 @@ void panel_parse_xml(xmlNodePtr node)
}
/* check the values */
if(settings.style < OLD_STYLE || settings.style > NEW_STYLE)
settings.style = NEW_STYLE;
if(settings.orientation < HORIZONTAL || settings.orientation > VERTICAL)
settings.orientation = HORIZONTAL;
if(settings.size < TINY || settings.size > LARGE)
settings.size = SMALL;
if(settings.num_groups < 1 || settings.num_groups > 2*NBGROUPS)
settings.num_groups = 10;
/* some things just look awful with old style */
if(settings.orientation == HORIZONTAL)
{
if (settings.popup_position == LEFT ||
settings.popup_position == RIGHT)
{
settings.style = NEW_STYLE;
}
}
else
{
if (settings.popup_position == TOP ||
settings.popup_position == BOTTOM)
{
settings.style = NEW_STYLE;
}
}
}
void panel_write_xml(xmlNodePtr root)
@ -598,9 +557,6 @@ void panel_write_xml(xmlNodePtr root)
snprintf(value, 2, "%d", settings.popup_position);
xmlSetProp(node, "popupposition", value);
snprintf(value, 2, "%d", settings.style);
xmlSetProp(node, "style", value);
if(settings.theme)
xmlSetProp(node, "icontheme", settings.theme);

1
panel/panel.h

@ -38,7 +38,6 @@ void panel_set_layer(int layer);
void panel_set_size(int size);
void panel_set_popup_position(int position);
void panel_set_style(int size);
void panel_set_theme(const char *theme);
void panel_set_num_groups(int n);

21
panel/popup.c

@ -323,8 +323,7 @@ PanelPopup *create_panel_popup(void)
g_object_ref(pp->button);
gtk_widget_set_name(pp->button, "xfce_popup_button");
if (settings.style == NEW_STYLE)
xfce_togglebutton_set_relief(XFCE_TOGGLEBUTTON(pp->button), GTK_RELIEF_NONE);
xfce_togglebutton_set_relief(XFCE_TOGGLEBUTTON(pp->button), GTK_RELIEF_NONE);
g_signal_connect(pp->button, "toggled", G_CALLBACK(toggle_popup), pp);
@ -381,7 +380,6 @@ PanelPopup *create_panel_popup(void)
gtk_widget_show_all(pp->frame);
panel_popup_set_size(pp, settings.size);
panel_popup_set_style(pp, settings.style);
return pp;
}
@ -512,23 +510,6 @@ void panel_popup_set_size(PanelPopup * pp, int size)
}
void panel_popup_set_style(PanelPopup * pp, int style)
{
if(style == OLD_STYLE)
xfce_togglebutton_set_relief(XFCE_TOGGLEBUTTON(pp->button), GTK_RELIEF_NORMAL);
else
xfce_togglebutton_set_relief(XFCE_TOGGLEBUTTON(pp->button), GTK_RELIEF_NONE);
/*
menu_item_set_style(pp->addtomenu_item, style);
for(li = pp->items; li && li->data; li = li->next)
{
MenuItem *mi = (MenuItem *) li->data;
menu_item_set_style(mi, style);
}
*/
}
void panel_popup_set_popup_position(PanelPopup * pp, int position)
{
GtkArrowType at;

1
panel/popup.h

@ -75,7 +75,6 @@ void panel_popup_remove_item(PanelPopup * pp, MenuItem * mi);
void panel_popup_set_size(PanelPopup * pp, int size);
void panel_popup_set_popup_position(PanelPopup * pp, int position);
void panel_popup_set_layer(PanelPopup * pp, int layer);
void panel_popup_set_style(PanelPopup * pp, int size);
void panel_popup_set_theme(PanelPopup * pp, const char *theme);
void hide_current_popup_menu(void);

357
plugins/switcher/switcher.c

@ -72,16 +72,12 @@ typedef struct
int ws_created_id;
int ws_destroyed_id;
gboolean show_minibuttons;
gboolean show_names;
gboolean graphical;
GtkWidget *frame;
GtkWidget *box;
GtkWidget *separators[2];
GtkWidget *minitables[2];
GtkWidget *minibuttons[4];
/* traditional switcher */
CdePager *cde_pager;
@ -198,41 +194,14 @@ static void screen_button_update_size(ScreenButton * sb)
h = (top_height[MEDIUM] + icon_size[MEDIUM]) / 2 - 5;
break;
}
h = -1;
h = -1;
gtk_widget_set_size_request(sb->button, w, h);
screen_button_update_label(sb, gtk_label_get_text(GTK_LABEL(sb->label)));
}
/* creation and destruction */
#if 0
static void screen_button_modify_style(ScreenButton *sb)
{
GtkStyle *style;
GtkWidget *w;
w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_realize(w);
style = gtk_widget_get_style(w);
gtk_widget_modify_bg(sb->button, GTK_STATE_PRELIGHT,
&(style->base[GTK_STATE_SELECTED]));
gtk_widget_modify_fg(sb->label, GTK_STATE_PRELIGHT,
&(style->fg[GTK_STATE_SELECTED]));
gtk_widget_modify_bg(sb->button, GTK_STATE_ACTIVE,
&(style->base[GTK_STATE_SELECTED]));
gtk_widget_modify_fg(sb->label, GTK_STATE_ACTIVE,
&(style->fg[GTK_STATE_SELECTED]));
gtk_widget_modify_bg(sb->button, GTK_STATE_NORMAL,
&(style->black));
gtk_widget_destroy(w);
}
#endif
static void ws_name_changed(NetkWorkspace *ws, ScreenButton *sb)
{
const char *name = netk_workspace_get_name(ws);
@ -542,132 +511,6 @@ GtkWidget *create_netk_pager(NetkScreen *screen)
return pager;
}
/* Mini buttons
* ------------
*/
static void mini_lock_cb(void)
{
hide_current_popup_menu();
exec_cmd("xflock", FALSE);
}
extern void info_panel_dialog(void);
static void mini_info_cb(void)
{
hide_current_popup_menu();
info_panel_dialog();
}
static void mini_palet_cb(void)
{
hide_current_popup_menu();
if(disable_user_config)
{
show_info(_("Access to the configuration system has been disabled.\n\n"
"Ask your system administrator for more information"));
return;
}
mcs_dialog(NULL);
}
static void mini_power_cb(GtkButton * b, GdkEventButton * ev, gpointer data)
{
hide_current_popup_menu();
quit(FALSE);
}
static void create_minibuttons(t_switcher *sw)
{
GdkPixbuf *pb[4];
GtkWidget *button;
int i;
GList *li;
pb[0] = get_minibutton_pixbuf(MINILOCK_ICON);
pb[1] = get_minibutton_pixbuf(MINIINFO_ICON);
pb[2] = get_minibutton_pixbuf(MINIPALET_ICON);
pb[3] = get_minibutton_pixbuf(MINIPOWER_ICON);
for(i = 0; i < 4; i++)
{
int size = minibutton_size[settings.size];
sw->minibuttons[i] = button = xfce_iconbutton_new_from_pixbuf(pb[i]);
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
gtk_widget_show(button);
gtk_widget_set_size_request(button,size,size);
g_object_unref(pb[i]);
for (li = sw->callbacks; li; li = li->next)
{
SignalCallback *sc = li->data;
g_signal_connect(sw->minibuttons[i], sc->signal,
sc->callback, sc->data);
}
}
/* fixed tooltips, since the user can't change the icon anyway */
add_tooltip(sw->minibuttons[0], _("Lock the screen"));
add_tooltip(sw->minibuttons[1], _("Info"));
add_tooltip(sw->minibuttons[2], _("Setup"));
add_tooltip(sw->minibuttons[3], _("Exit"));
/* signals */
g_signal_connect(sw->minibuttons[0], "clicked",
G_CALLBACK(mini_lock_cb), NULL);
g_signal_connect(sw->minibuttons[1], "clicked",
G_CALLBACK(mini_info_cb), NULL);
g_signal_connect(sw->minibuttons[2], "clicked",
G_CALLBACK(mini_palet_cb), NULL);
g_signal_connect(sw->minibuttons[3], "clicked",
G_CALLBACK(mini_power_cb), NULL);
}
void add_minibuttons(t_switcher *sw)
{
create_minibuttons(sw);
gtk_table_attach(GTK_TABLE(sw->minitables[0]),
sw->minibuttons[0],
0, 1, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0);
gtk_table_attach(GTK_TABLE(sw->minitables[1]),
sw->minibuttons[2],
0, 1, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0);
/* find if we want the minibuttons horizontally or vertically */
if((settings.orientation == VERTICAL && settings.size > SMALL) ||
(settings.orientation == HORIZONTAL && settings.size <= SMALL))
{
gtk_table_attach(GTK_TABLE(sw->minitables[0]),
sw->minibuttons[1],
1, 2, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0);
gtk_table_attach(GTK_TABLE(sw->minitables[1]),
sw->minibuttons[3],
1, 2, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0);
}
else
{
gtk_table_attach(GTK_TABLE(sw->minitables[0]),
sw->minibuttons[1],
0, 1, 1, 2, GTK_EXPAND, GTK_EXPAND, 0, 0);
gtk_table_attach(GTK_TABLE(sw->minitables[1]),
sw->minibuttons[3],
0, 1, 1, 2, GTK_EXPAND, GTK_EXPAND, 0, 0);
}
}
/* Desktop switcher
* ----------------
*/
@ -678,23 +521,12 @@ static void arrange_switcher(t_switcher *sw);
/* settings */
static void switcher_set_size(Control *control, int size)
{
int i;
t_switcher *sw;
int s;
gtk_widget_set_size_request(control->base, -1, -1);
sw = control->data;
s = minibutton_size[size];
for (i = 0; i < 4; i++)
{
gtk_widget_destroy(sw->minibuttons[i]);
}
add_minibuttons(sw);
if (sw->graphical)
{
netk_pager_update_size(sw->netk_pager, sw->screen);
@ -705,51 +537,6 @@ static void switcher_set_size(Control *control, int size)
}
}
static void switcher_set_style(Control *control, int style)
{
t_switcher *sw;
sw = control->data;
if (style == OLD_STYLE)
{
gtk_widget_hide(sw->separators[0]);
gtk_widget_hide(sw->separators[1]);
gtk_frame_set_shadow_type(GTK_FRAME(sw->frame), GTK_SHADOW_OUT);
}
else
{
gtk_widget_show(sw->separators[0]);
gtk_widget_show(sw->separators[1]);
gtk_frame_set_shadow_type(GTK_FRAME(sw->frame), GTK_SHADOW_NONE);
}
}
static void switcher_set_theme(Control *control, const char *theme)
{
GdkPixbuf *pb [4];
t_switcher *sw;
int i;
sw = control->data;
pb[0] = get_minibutton_pixbuf(MINILOCK_ICON);
pb[1] = get_minibutton_pixbuf(MINIINFO_ICON);
pb[2] = get_minibutton_pixbuf(MINIPALET_ICON);
pb[3] = get_minibutton_pixbuf(MINIPOWER_ICON);
for (i = 0; i < 4; i++)
{
xfce_iconbutton_set_pixbuf(XFCE_ICONBUTTON(sw->minibuttons[i]),
pb[i]);
g_object_unref(pb[i]);
}
switcher_set_size(control, settings.size);
}
static void switcher_set_orientation(Control *control, int orientation)
{
t_switcher *sw;
@ -757,7 +544,6 @@ static void switcher_set_orientation(Control *control, int orientation)
sw = control->data;
arrange_switcher(sw);
switcher_set_style(control, settings.style);
switcher_set_size(control, settings.size);
}
@ -776,22 +562,6 @@ static void switcher_read_config(Control *control, xmlNodePtr node)
sw = control->data;
/* properties */
value = xmlGetProp(node, "showminibuttons");
if (value)
{
i = atoi(value);
g_free(value);
if (i == 0)
{
sw->show_minibuttons = FALSE;
gtk_widget_hide(sw->minitables[0]);
gtk_widget_hide(sw->minitables[1]);
}
}
value = xmlGetProp(node, "graphical");
if (value)
@ -810,13 +580,13 @@ static void switcher_read_config(Control *control, xmlNodePtr node)
cde_pager_free(sw->cde_pager);
sw->cde_pager = NULL;
align = gtk_alignment_new(0.5, 0.5, 0, 0);
align = gtk_alignment_new(0, 0, 1, 1);
gtk_widget_show(align);
gtk_container_add(GTK_CONTAINER(align), sw->netk_pager);
gtk_box_pack_start(GTK_BOX(sw->box), align,
TRUE, TRUE, 2);
gtk_box_reorder_child(GTK_BOX(sw->box), align, 2);
gtk_box_reorder_child(GTK_BOX(sw->box), align, 1);
}
}
}
@ -828,9 +598,6 @@ static void switcher_write_config(Control *control, xmlNodePtr node)
sw = control->data;
snprintf(prop, 3, "%d", sw->show_minibuttons ? 1 : 0);
xmlSetProp(node, "showminibuttons", prop);
snprintf(prop, 3, "%d", sw->graphical ? 1 : 0);
xmlSetProp(node, "graphical", prop);
}
@ -840,7 +607,6 @@ static void switcher_attach_callback(Control *control, const char *signal,
{
SignalCallback *sc;
t_switcher *sw;
int i;
sw = control->data;
@ -855,11 +621,6 @@ static void switcher_attach_callback(Control *control, const char *signal,
{
cde_pager_attach_callback(sw->cde_pager, sc);
}
for (i = 0; i < 4; i++)
{
g_signal_connect(sw->minibuttons[i], signal, callback, data);
}
}
static void arrange_switcher(t_switcher *sw)
@ -899,32 +660,17 @@ static void arrange_switcher(t_switcher *sw)
sw->cde_pager = create_cde_pager(sw->screen, sw->screen_names);
}
sw->minitables[0] = gtk_table_new(2,2,FALSE);
sw->minitables[1] = gtk_table_new(2,2,FALSE);
add_minibuttons(sw);
/* show the widgets */
gtk_widget_show(sw->box);
if (sw->show_minibuttons)
{
gtk_widget_show(sw->minitables[0]);
gtk_widget_show(sw->minitables[1]);
}
if (settings.style == NEW_STYLE)
{
gtk_widget_show(sw->separators[0]);
gtk_widget_show(sw->separators[1]);
}
gtk_widget_show(sw->separators[0]);
gtk_widget_show(sw->separators[1]);
/* packing the widgets */
gtk_container_add(GTK_CONTAINER(sw->frame),sw->box);
gtk_box_pack_start(GTK_BOX(sw->box), sw->separators[0], TRUE, TRUE, 2);
gtk_box_pack_start(GTK_BOX(sw->box), sw->minitables[0], TRUE, TRUE, 0);
if (sw->graphical)
{
GtkWidget *align;
@ -942,8 +688,6 @@ static void arrange_switcher(t_switcher *sw)
TRUE, TRUE, 2);
}
gtk_box_pack_start(GTK_BOX(sw->box), sw->minitables[1], TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(sw->box), sw->separators[1], TRUE, TRUE, 2);
/* attach callbacks */
@ -1003,11 +747,9 @@ t_switcher *switcher_new(NetkScreen *screen)
sw->screen_names =
g_ptr_array_sized_new(netk_screen_get_workspace_count(screen));
sw->show_minibuttons = TRUE;
sw->show_names = TRUE;
sw->graphical = FALSE;
sw->frame = gtk_frame_new(NULL);
sw->frame = gtk_alignment_new(0.5,0.5,0,0);
gtk_widget_show(sw->frame);
/* this creates all widgets */
@ -1057,15 +799,11 @@ typedef struct
{
t_switcher *sw;
gboolean backup_show_minibuttons;
gboolean backup_show_names;
gboolean backup_graphical;
GtkWidget *dialog;
GtkWidget *revert;
GtkWidget *mini_checkbutton;
GtkWidget *names_checkbutton;
GtkWidget *graphical_checkbutton;
}
t_switcher_dialog;
@ -1075,48 +813,6 @@ static void switcher_dialog_done(GtkWidget *b, t_switcher_dialog *sd)
g_free(sd);
}
static void show_minibuttons_changed(GtkToggleButton *tb, t_switcher_dialog *sd)
{
t_switcher *sw = sd->sw;
gboolean show;
show = gtk_toggle_button_get_active(tb);
sw->show_minibuttons = show;
if(show)
{
gtk_widget_show(sw->minitables[0]);
gtk_widget_show(sw->minitables[1]);
}
else
{
gtk_widget_hide(sw->minitables[0]);
gtk_widget_hide(sw->minitables[1]);
}
gtk_widget_set_sensitive(sd->revert, TRUE);
}
#if 0
static void show_names_changed(GtkToggleButton *tb, t_switcher_dialog *sd)
{
t_switcher *sw = sd->sw;
gboolean show;
show = gtk_toggle_button_get_active(tb);
sw->show_names = show;
if(show)
{
}
else
{
}
gtk_widget_set_sensitive(sd->revert, TRUE);
}
#endif
static void graphical_changed(GtkToggleButton *tb, t_switcher_dialog *sd)
{
t_switcher *sw = sd->sw;
@ -1153,7 +849,7 @@ static void graphical_changed(GtkToggleButton *tb, t_switcher_dialog *sd)
gtk_box_pack_start(GTK_BOX(sw->box), align,
TRUE, TRUE, 2);
gtk_box_reorder_child(GTK_BOX(sw->box), align, 2);
gtk_box_reorder_child(GTK_BOX(sw->box), align, 1);
}
else
{
@ -1161,7 +857,7 @@ static void graphical_changed(GtkToggleButton *tb, t_switcher_dialog *sd)
gtk_box_pack_start(GTK_BOX(sw->box), sw->cde_pager->box,
TRUE, TRUE, 2);
gtk_box_reorder_child(GTK_BOX(sw->box), sw->cde_pager->box, 2);
gtk_box_reorder_child(GTK_BOX(sw->box), sw->cde_pager->box, 1);
}
for (li = sw->callbacks; li; li = li->next)
@ -1184,12 +880,6 @@ static void graphical_changed(GtkToggleButton *tb, t_switcher_dialog *sd)
static void switcher_revert(GtkWidget *b, t_switcher_dialog *sd)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sd->mini_checkbutton),
sd->backup_show_minibuttons);
/* gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sd->names_checkbutton),
sd->backup_show_names);
*/
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sd->graphical_checkbutton),
sd->backup_graphical);
}
@ -1205,8 +895,6 @@ static void switcher_add_options(Control *control, GtkContainer *container,
sd->sw = control->data;
sd->backup_show_minibuttons = sd->sw->show_minibuttons;
sd->backup_show_names = sd->sw->show_names;
sd->backup_graphical = sd->sw->graphical;
sd->dialog = gtk_widget_get_toplevel(revert);
@ -1214,32 +902,12 @@ static void switcher_add_options(Control *control, GtkContainer *container,
sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
vbox = gtk_vbox_new(FALSE, 4);
vbox = gtk_vbox_new(FALSE, 6);
gtk_widget_show(vbox);
gtk_container_add(container, vbox);
/* show minibuttons ? */
hbox = gtk_hbox_new(FALSE, 4);
gtk_widget_show(hbox);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new(_("Show minibuttons"));
gtk_widget_show(label);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_size_group_add_widget(sg,label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
sd->mini_checkbutton = gtk_check_button_new();
gtk_widget_show(sd->mini_checkbutton);
gtk_box_pack_start(GTK_BOX(hbox), sd->mini_checkbutton, FALSE, FALSE, 0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sd->mini_checkbutton),
sd->sw->show_minibuttons);
g_signal_connect(sd->mini_checkbutton, "toggled",
G_CALLBACK(show_minibuttons_changed), sd);
/* show graphical pager ?*/
hbox = gtk_hbox_new(FALSE, 4);
hbox = gtk_hbox_new(FALSE, 6);
gtk_widget_show(hbox);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@ -1282,7 +950,6 @@ gboolean create_switcher_control(Control *control)
control->data = sw;
control->with_popup = FALSE;
switcher_set_style(control, settings.style);
switcher_set_size(control, settings.size);
return TRUE;
@ -1310,8 +977,6 @@ G_MODULE_EXPORT void xfce_control_class_init(ControlClass *cc)
cc->set_orientation = switcher_set_orientation;
cc->set_size = switcher_set_size;
cc->set_style = switcher_set_style;
cc->set_theme = switcher_set_theme;
}

17
plugins/systembuttons/systembuttons.c

@ -344,6 +344,19 @@ static void systembuttons_write_config(Control * control, xmlNodePtr node)
}
/* global prefs */
static void systembuttons_set_size(Control *control, int size)
{
int s1, s2;
s1 = icon_size[size] + border_width;
s2 = s1 / 2 + border_width;
if (settings.orientation == VERTICAL)
gtk_widget_set_size_request(control->base, s1, s2);
else
gtk_widget_set_size_request(control->base, s2, s1);
}
static void systembuttons_set_orientation(Control *control, int orientation)
{
t_systembuttons *sb = control->data;
@ -548,7 +561,7 @@ gboolean create_systembuttons_control(Control * control)
control->data = (gpointer) sb;
control->with_popup = FALSE;
control_set_size(control, settings.size);
systembuttons_set_size(control, settings.size);
return TRUE;
}
@ -571,7 +584,7 @@ G_MODULE_EXPORT void xfce_control_class_init(ControlClass *cc)
cc->write_config = systembuttons_write_config;
cc->attach_callback = systembuttons_attach_callback;
/* no set size => xfce sets size base container */
cc->set_size = systembuttons_set_size;
cc->set_orientation = systembuttons_set_orientation;
cc->set_theme = systembuttons_set_theme;
cc->add_options = systembuttons_add_options;

2
settings/xfce_settings.h

@ -28,7 +28,6 @@ enum {
XFCE_LAYER,
XFCE_SIZE,
XFCE_POPUPPOSITION,
XFCE_STYLE,
XFCE_THEME,
XFCE_POSITION,
XFCE_OPTIONS
@ -49,7 +48,6 @@ static char *xfce_settings_names [] = {
"layer",
"size",
"popupposition",
"style",
"theme",
"position"
};

88
settings/xfce_settings_dialog.c

@ -42,10 +42,6 @@
enum
{ LEFT, RIGHT, TOP, BOTTOM };
/* panel styles */
enum
{ OLD_STYLE, NEW_STYLE };
/* panel orientation */
enum
{ HORIZONTAL, VERTICAL };
@ -60,14 +56,12 @@ enum
* size: option menu
* panel orientation: option menu
* popup position: option menu
* style: option menu (should be radio buttons according to GNOME HIG)
* icon theme: option menu
* position: option menu + button (centering only)
*/
static GtkWidget *orientation_menu;
static GtkWidget *size_menu;
static GtkWidget *popup_position_menu;
static GtkWidget *style_menu;
static GtkWidget *theme_menu;
static GtkWidget *layer_menu;
@ -122,7 +116,6 @@ static int bu_orientation;
static int bu_layer;
static int bu_size;
static int bu_popup_position;
static int bu_style;
static char *bu_theme;
static void xfce_create_backup(void)
@ -141,9 +134,6 @@ static void xfce_create_backup(void)
setting = &xfce_options[XFCE_POPUPPOSITION];
bu_popup_position = setting->data.v_int;
setting = &xfce_options[XFCE_STYLE];
bu_style = setting->data.v_int;
setting = &xfce_options[XFCE_THEME];
bu_theme = g_strdup(setting->data.v_string);
@ -166,7 +156,6 @@ static void xfce_restore_backup(void)
gtk_option_menu_set_history(GTK_OPTION_MENU(popup_position_menu),
bu_popup_position);
gtk_option_menu_set_history(GTK_OPTION_MENU(style_menu), bu_style);
gtk_option_menu_set_history(GTK_OPTION_MENU(theme_menu),
backup_theme_index);
@ -228,56 +217,6 @@ static void add_size_menu(GtkWidget * option_menu, int size)
NULL);
}
/* style */
static void style_changed(GtkOptionMenu * menu)
{
int n = gtk_option_menu_get_history(menu);
McsSetting *setting = &xfce_options[XFCE_STYLE];
if(n == setting->data.v_int)
return;
setting->data.v_int = n;
mcs_manager_set_setting(mcs_manager, setting, CHANNEL);
mcs_manager_notify(mcs_manager, CHANNEL);
gtk_widget_set_sensitive(revert, TRUE);
}
static void add_style_menu(GtkWidget * option_menu, int style)
{
GtkWidget *menu = gtk_menu_new();
GtkWidget *item;
int n, pos;
item = gtk_menu_item_new_with_label(_("Traditional"));
gtk_widget_show(item);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
item = gtk_menu_item_new_with_label(_("Modern"));
gtk_widget_show(item);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu);
gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), style);
g_signal_connect(option_menu, "changed", G_CALLBACK(style_changed), NULL);
n = xfce_options[XFCE_ORIENTATION].data.v_int;
pos = xfce_options[XFCE_POPUPPOSITION].data.v_int;
if ((n == HORIZONTAL && (pos == LEFT || pos == RIGHT)) ||
(n == VERTICAL && (pos == TOP || pos == BOTTOM)))
{
gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), NEW_STYLE);
gtk_widget_set_sensitive(option_menu, FALSE);
}
else
{
gtk_widget_set_sensitive(option_menu, TRUE);
}
}
/* Panel Orientation */
static void orientation_changed(GtkOptionMenu * menu)
{
@ -310,17 +249,6 @@ static void orientation_changed(GtkOptionMenu * menu)
gtk_option_menu_set_history(GTK_OPTION_MENU(popup_position_menu), pos);
if ((n == HORIZONTAL && (pos == LEFT || pos == RIGHT)) ||
(n == VERTICAL && (pos == TOP || pos == BOTTOM)))
{
gtk_option_menu_set_history(GTK_OPTION_MENU(style_menu), NEW_STYLE);
gtk_widget_set_sensitive(style_menu, FALSE);
}
else
{
gtk_widget_set_sensitive(style_menu, TRUE);
}
gtk_widget_set_sensitive(revert, TRUE);
}
@ -556,22 +484,6 @@ static void add_style_box(GtkBox * box, GtkSizeGroup *sg)
xfce_options[XFCE_POPUPPOSITION].data.v_int);
gtk_box_pack_start(GTK_BOX(hbox), popup_position_menu, TRUE, TRUE, 0);
/* style */
hbox = gtk_hbox_new(FALSE, BORDER);
gtk_widget_show(hbox);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
label = gtk_label_new(_("Panel style:"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_widget_show(label);
gtk_size_group_add_widget(sg, label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
style_menu = gtk_option_menu_new();
gtk_widget_show(style_menu);
add_style_menu(style_menu, xfce_options[XFCE_STYLE].data.v_int);
gtk_box_pack_start(GTK_BOX(hbox), style_menu, TRUE, TRUE, 0);
/* icon theme */
hbox = gtk_hbox_new(FALSE, BORDER);
gtk_widget_show(hbox);

5
settings/xfce_settings_plugin.c

@ -109,11 +109,6 @@ static void xfce_init_options(void)
opt->type = MCS_TYPE_INT;
opt->data.v_int = 1;
break;
case XFCE_STYLE:
opt->name = "style";
opt->type = MCS_TYPE_INT;
opt->data.v_int = 1;
break;
case XFCE_THEME:
opt->name = "theme";
opt->type = MCS_TYPE_STRING;

Loading…
Cancel
Save