Commit c0b7213e authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

add a tooltip and use button-widget and a tile for logout

Tue Jan 05 01:22:33 1999  George Lebl  <jirka@5z.com>

        * logout.c,panel_config_global.c,panel-types.h,session.c: add a
          tooltip and use button-widget and a tile for logout

        * button-widget.c: scale large icons while preserving aspect

        * drawer-widget.c: get the toplevel panel and place drawers next to
          panels in the correct(tm) way

        * extern.c,applet.c,panel.c,session.c,panel_config_global.[ch]:
          made the popup menu placement be optionally not placed outside
          of the panel
parent 05d3948d
Tue Jan 05 01:22:33 1999 George Lebl <jirka@5z.com>
* logout.c,panel_config_global.c,panel-types.h,session.c: add a
tooltip and use button-widget and a tile for logout
* button-widget.c: scale large icons while preserving aspect
* drawer-widget.c: get the toplevel panel and place drawers next to
panels in the correct(tm) way
* extern.c,applet.c,panel.c,session.c,panel_config_global.[ch]:
made the popup menu placement be optionally not placed outside
of the panel
Mon Jan 04 01:33:53 1999 George Lebl <jirka@5z.com>
* menu.c: reverse redhat check for menu properties, fix properties
......
Tue Jan 05 01:22:33 1999 George Lebl <jirka@5z.com>
* logout.c,panel_config_global.c,panel-types.h,session.c: add a
tooltip and use button-widget and a tile for logout
* button-widget.c: scale large icons while preserving aspect
* drawer-widget.c: get the toplevel panel and place drawers next to
panels in the correct(tm) way
* extern.c,applet.c,panel.c,session.c,panel_config_global.[ch]:
made the popup menu placement be optionally not placed outside
of the panel
Mon Jan 04 01:33:53 1999 George Lebl <jirka@5z.com>
* menu.c: reverse redhat check for menu properties, fix properties
......
......@@ -33,7 +33,7 @@ extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save;
extern GtkTooltips *panel_tooltips;
extern GlobalConfig global_config;
static void
move_applet_callback(GtkWidget *widget, AppletInfo *info)
......@@ -344,7 +344,8 @@ show_applet_menu(AppletInfo *info, GdkEventButton *event)
snapped_widget_queue_pop_down(SNAPPED_WIDGET(panel));
}
info->menu_age = 0;
gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL, applet_menu_position,
gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL,
global_config.off_panel_popups?applet_menu_position:NULL,
info, event->button, event->time);
}
......
......@@ -38,15 +38,15 @@ typedef void (*VoidSignal) (GtkObject * object,
static GList *buttons=NULL;
/*the tiles go here*/
static GdkPixmap *tiles_up[LAST_TILE]={NULL,NULL,NULL};
static GdkBitmap *tiles_up_mask[LAST_TILE]={NULL,NULL,NULL};
static GdkPixmap *tiles_down[LAST_TILE]={NULL,NULL,NULL};
static GdkBitmap *tiles_down_mask[LAST_TILE]={NULL,NULL,NULL};
static int tile_border[LAST_TILE]={0,0,0};
static int tile_depth[LAST_TILE]={0,0,0};
static GdkPixmap *tiles_up[LAST_TILE]={NULL,NULL,NULL,NULL};
static GdkBitmap *tiles_up_mask[LAST_TILE]={NULL,NULL,NULL,NULL};
static GdkPixmap *tiles_down[LAST_TILE]={NULL,NULL,NULL,NULL};
static GdkBitmap *tiles_down_mask[LAST_TILE]={NULL,NULL,NULL,NULL};
static int tile_border[LAST_TILE]={0,0,0,0};
static int tile_depth[LAST_TILE]={0,0,0,0};
/*are tiles enabled*/
static int tiles_enabled[LAST_TILE]={FALSE,FALSE,FALSE};
static int tiles_enabled[LAST_TILE]={FALSE,FALSE,FALSE,FALSE};
static GtkWidgetClass *parent_class;
......@@ -561,6 +561,7 @@ static void
loadup_file(GdkPixmap **pixmap, GdkBitmap **mask, char *file)
{
GdkImlibImage *im = NULL;
int w,h;
if(*file!='/') {
char *f;
......@@ -577,7 +578,22 @@ loadup_file(GdkPixmap **pixmap, GdkBitmap **mask, char *file)
return;
}
gdk_imlib_render (im, BIG_ICON_SIZE, BIG_ICON_SIZE);
w = im->rgb_width;
h = im->rgb_height;
if(w>h) {
if(w>BIG_ICON_SIZE) {
h = h*((double)BIG_ICON_SIZE/w);
w = BIG_ICON_SIZE;
}
} else {
if(h>BIG_ICON_SIZE) {
w = w*((double)BIG_ICON_SIZE/h);
h = BIG_ICON_SIZE;
}
}
w = w>0?w:1;
h = h>0?h:1;
gdk_imlib_render (im, w, h);
*pixmap = gdk_imlib_copy_image (im);
*mask = gdk_imlib_copy_mask (im);
......
......@@ -194,6 +194,9 @@ drawer_widget_get_pos(DrawerWidget *drawer, gint16 *x, gint16 *y,
/*get the parent of the applet*/
ppanel = panel->master_widget->parent;
/*go the the toplevel panel widget*/
while(ppanel->parent)
ppanel = ppanel->parent;
if (GTK_WIDGET_REALIZED (ppanel)) {
gdk_window_get_origin (panel->master_widget->window, &bx, &by);
if(GTK_WIDGET_NO_WINDOW(panel->master_widget)) {
......@@ -205,24 +208,21 @@ drawer_widget_get_pos(DrawerWidget *drawer, gint16 *x, gint16 *y,
gdk_window_get_origin (ppanel->window, &px, &py);
gdk_window_get_size (ppanel->window, &pw, &ph);
/*FIXME: THE +/- 2 is a HACK!, the border of a frame
could be different ... we'd better figure out the
GoodSolution(tm) for this*/
switch(drawer->orient) {
case ORIENT_UP:
*x = bx+(bw-width)/2;
*y = py - height - 2;
*y = py - height;
break;
case ORIENT_DOWN:
*x = bx+(bw-width)/2;
*y = py + ph + 2;
*y = py + ph;
break;
case ORIENT_LEFT:
*x = px - width - 2;
*x = px - width;
*y = by+(bh-height)/2;
break;
case ORIENT_RIGHT:
*x = px + pw + 2;
*x = px + pw;
*y = by+(bh-height)/2;
break;
}
......
......@@ -591,7 +591,7 @@ s_panelspot_show_menu(POA_GNOME_PanelSpot *servant,
ext->info->menu_age = 0;
gtk_menu_popup(GTK_MENU(ext->info->menu), NULL, NULL,
applet_menu_position,
global_config.off_panel_popups?applet_menu_position:NULL,
ext->info, 3, GDK_CURRENT_TIME);
}
......
......@@ -7,6 +7,8 @@
#include "panel-include.h"
extern GtkTooltips *panel_tooltips;
static void
logout(void)
{
......@@ -20,20 +22,19 @@ create_logout_widget(void)
GtkWidget *pixmap;
char *pixmap_name;
pixmap_name = gnome_unconditional_pixmap_file("gnome-term-night.png");
pixmap_name = gnome_pixmap_file("gnome-term-night.png");
if (!pixmap_name)
button = gtk_button_new_with_label(_("Log out"));
else {
button = gtk_button_new();
pixmap = gnome_pixmap_new_from_file(pixmap_name);
button = button_widget_new_from_file(pixmap_name,
LOGOUT_TILE,
FALSE,
ORIENT_UP);
g_free(pixmap_name);
gtk_container_add(GTK_CONTAINER(button), pixmap);
gtk_widget_show(pixmap);
gtk_widget_set_usize(button, 48, 48);
/*gtk_widget_set_usize(button, pixmap->requisition.width,
pixmap->requisition.height);*/
}
gtk_tooltips_set_tip (panel_tooltips,button,_("Log out of GNOME"),NULL);
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(logout), NULL);
......
......@@ -14,6 +14,7 @@ struct _GlobalConfig {
int tooltips_enabled;
int show_small_icons;
int show_dot_buttons;
int off_panel_popups;
int prompt_for_logout;
PanelMovementType movement_type;
int disable_animations;
......
......@@ -13,6 +13,7 @@ typedef enum {
LAUNCHER_TILE=0,
DRAWER_TILE,
MENU_TILE,
LOGOUT_TILE,
LAST_TILE
} PanelTileType;
......
......@@ -38,6 +38,8 @@ extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save;
extern GlobalConfig global_config;
extern GtkTooltips *panel_tooltips;
/*???? this might be ugly, but I guess we can safely assume that we can only
......@@ -784,7 +786,8 @@ panel_event(GtkWidget *widget, GdkEvent *event, PanelData *pd)
TRUE);
pd->menu_age = 0;
gtk_menu_popup(GTK_MENU(panel_menu), NULL, NULL,
panel_menu_position,
global_config.off_panel_popups?
panel_menu_position:NULL,
widget, bevent->button,
bevent->time);
return TRUE;
......
......@@ -448,6 +448,16 @@ misc_notebook_page(void)
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE,
CONFIG_PADDING_SIZE);
/* Off Panel Popup menus */
button = gtk_check_button_new_with_label (_("Show popup menus outside of panels"));
if (temp_config.off_panel_popups)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (set_toggle_button_value),
&(temp_config.off_panel_popups));
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE,
CONFIG_PADDING_SIZE);
/* Movement frame */
frame = gtk_frame_new (_("Movement"));
gtk_container_set_border_width(GTK_CONTAINER (frame), CONFIG_PADDING_SIZE);
......@@ -521,7 +531,8 @@ panel_config_global(void)
char *icon_titles[]={
_("Launcher icon"),
_("Drawer icon"),
_("Menu icon")};
_("Menu icon"),
_("Logout icon")};
int i;
/* return if the window is already up. */
......
......@@ -14,6 +14,7 @@ struct _GlobalConfig {
int tooltips_enabled;
int show_small_icons;
int show_dot_buttons;
int off_panel_popups;
int prompt_for_logout;
PanelMovementType movement_type;
int disable_animations;
......
......@@ -494,6 +494,8 @@ do_session_save(GnomeClient *client,
global_config.show_small_icons);
gnome_config_set_bool("show_dot_buttons",
global_config.show_dot_buttons);
gnome_config_set_bool("off_panel_popups",
global_config.off_panel_popups);
gnome_config_set_bool("prompt_for_logout",
global_config.prompt_for_logout);
gnome_config_set_bool("disable_animations",
......@@ -1006,7 +1008,7 @@ void
load_up_globals(void)
{
GString *buf;
char *tile_def[]={"normal","purple","green"};
char *tile_def[]={"normal","purple","green","blue"};
int i;
buf = g_string_new(NULL);
......@@ -1024,6 +1026,9 @@ load_up_globals(void)
global_config.show_dot_buttons =
gnome_config_get_bool("show_dot_buttons=FALSE");
global_config.off_panel_popups =
gnome_config_get_bool("off_panel_popups=TRUE");
global_config.prompt_for_logout =
gnome_config_get_bool("prompt_for_logout=TRUE");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment