From: Andreas Fink Date: Sun, 12 Dec 2010 08:57:51 +0000 (+0000) Subject: *add* remove of tooltip = En/Disabled. it's renamed to task_tooltip to enable/disable... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=857a47544272e432112157dc55694faf079b8c77;p=chaz%2Ftint2 *add* remove of tooltip = En/Disabled. it's renamed to task_tooltip to enable/disable task/clock tooltip separatly (tooltip = N is equivalent to task_tooltip = N for backwards compatibility) --- diff --git a/sample/icon_and_text_1.tint2rc b/sample/icon_and_text_1.tint2rc index 677cc58..e866de4 100644 --- a/sample/icon_and_text_1.tint2rc +++ b/sample/icon_and_text_1.tint2rc @@ -56,6 +56,7 @@ task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 +task_tooltip = 0 # Task Icons task_icon_asb = 70 0 0 @@ -90,7 +91,6 @@ clock_background_id = 0 clock_rclick_command = orage # Tooltips -tooltip = 0 tooltip_padding = 2 2 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_and_text_2.tint2rc b/sample/icon_and_text_2.tint2rc index 7dc18db..c30f43d 100644 --- a/sample/icon_and_text_2.tint2rc +++ b/sample/icon_and_text_2.tint2rc @@ -56,6 +56,7 @@ task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 +task_tooltip = 0 # Task Icons task_icon_asb = 80 0 0 @@ -89,7 +90,6 @@ clock_background_id = 1 clock_rclick_command = gsimplecal # Tooltips -tooltip = 0 tooltip_padding = 5 0 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_and_text_3.tint2rc b/sample/icon_and_text_3.tint2rc index 325bc54..f333266 100644 --- a/sample/icon_and_text_3.tint2rc +++ b/sample/icon_and_text_3.tint2rc @@ -62,6 +62,7 @@ task_background_id = 2 task_active_background_id = 3 task_urgent_background_id = 4 task_iconified_background_id = 2 +task_tooltip = 1 # Task Icons task_icon_asb = 80 0 0 @@ -95,7 +96,6 @@ clock_background_id = 0 clock_rclick_command = gsimplecal # Tooltips -tooltip = 1 tooltip_padding = 5 0 tooltip_show_timeout = 1.2 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_and_text_4.tint2rc b/sample/icon_and_text_4.tint2rc index 06430f1..0dcabd7 100644 --- a/sample/icon_and_text_4.tint2rc +++ b/sample/icon_and_text_4.tint2rc @@ -62,6 +62,7 @@ task_background_id = 2 task_active_background_id = 1 task_urgent_background_id = 4 task_iconified_background_id = 2 +task_tooltip = 0 # Task Icons task_icon_asb = 100 0 0 @@ -95,7 +96,6 @@ clock_padding = 4 4 clock_background_id = 1 # Tooltips -tooltip = 0 tooltip_padding = 0 0 tooltip_show_timeout = 0 tooltip_hide_timeout = 0 diff --git a/sample/icon_only_1.tint2rc b/sample/icon_only_1.tint2rc index 8c433c4..7708b58 100644 --- a/sample/icon_only_1.tint2rc +++ b/sample/icon_only_1.tint2rc @@ -74,6 +74,7 @@ task_background_id = 0 task_active_background_id = 5 task_urgent_background_id = 6 task_iconified_background_id = 0 +task_tooltip = 1 # Task Icons task_icon_asb = 100 -25 -8 @@ -109,7 +110,6 @@ clock_background_id = 0 clock_rclick_command = gsimplecal # Tooltips -tooltip = 1 tooltip_padding = 5 3 tooltip_show_timeout = 0.8 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_only_2.tint2rc b/sample/icon_only_2.tint2rc index 0504ea9..4d1c41f 100644 --- a/sample/icon_only_2.tint2rc +++ b/sample/icon_only_2.tint2rc @@ -62,6 +62,7 @@ task_background_id = 0 task_active_background_id = 3 task_urgent_background_id = 3 task_iconified_background_id = 0 +task_tooltip = 1 # Task Icons task_icon_asb = 90 -100 -20 @@ -97,7 +98,6 @@ clock_background_id = 0 clock_rclick_command = gsimplecal # Tooltips -tooltip = 1 tooltip_padding = 2 2 tooltip_show_timeout = 0.9 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_only_3.tint2rc b/sample/icon_only_3.tint2rc index 24e0da1..0069fbe 100644 --- a/sample/icon_only_3.tint2rc +++ b/sample/icon_only_3.tint2rc @@ -62,6 +62,7 @@ task_background_id = 0 task_active_background_id = 2 task_urgent_background_id = 4 task_iconified_background_id = 0 +task_tooltip = 0 # Task Icons task_icon_asb = 70 0 0 @@ -86,7 +87,6 @@ systray_icon_size = 20 systray_icon_asb = 100 0 0 # Tooltips -tooltip = 0 tooltip_padding = 2 2 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_only_4.tint2rc b/sample/icon_only_4.tint2rc index 0c4264d..fbbc760 100644 --- a/sample/icon_only_4.tint2rc +++ b/sample/icon_only_4.tint2rc @@ -62,6 +62,7 @@ task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 4 task_iconified_background_id = 3 +task_tooltip = 1 # Task Icons task_icon_asb = 90 0 0 @@ -86,7 +87,6 @@ systray_icon_size = 20 systray_icon_asb = 100 0 -10 # Tooltips -tooltip = 1 tooltip_padding = 5 0 tooltip_show_timeout = 0.8 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_only_6.tint2rc b/sample/icon_only_6.tint2rc index 1451055..75a59d7 100644 --- a/sample/icon_only_6.tint2rc +++ b/sample/icon_only_6.tint2rc @@ -62,6 +62,7 @@ task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 +task_tooltip = 1 # Task Icons task_icon_asb = 100 0 0 @@ -97,7 +98,6 @@ clock_background_id = 1 clock_rclick_command = zenity --calendar # Tooltips -tooltip = 1 tooltip_padding = 3 2 tooltip_show_timeout = 0.9 tooltip_hide_timeout = 0.3 diff --git a/sample/icon_only_7.tint2rc b/sample/icon_only_7.tint2rc index ae7b061..f60de10 100644 --- a/sample/icon_only_7.tint2rc +++ b/sample/icon_only_7.tint2rc @@ -56,6 +56,7 @@ task_background_id = 0 task_active_background_id = 3 task_urgent_background_id = 0 task_iconified_background_id = 0 +task_tooltip = 1 # Task Icons task_icon_asb = 100 0 0 @@ -93,7 +94,6 @@ time1_timezone = :Europe/Paris time2_timezone = :Europe/Moscow # Tooltips -tooltip = 1 tooltip_padding = 5 4 tooltip_show_timeout = 0.8 tooltip_hide_timeout = 0.3 diff --git a/sample/text_only_1.tint2rc b/sample/text_only_1.tint2rc index faf7f20..80c71a6 100644 --- a/sample/text_only_1.tint2rc +++ b/sample/text_only_1.tint2rc @@ -68,6 +68,7 @@ task_background_id = 4 task_active_background_id = 1 task_urgent_background_id = 0 task_iconified_background_id = 4 +task_tooltip = 0 # Task Icons task_icon_asb = 100 -90 -15 @@ -103,7 +104,6 @@ clock_background_id = 1 clock_rclick_command = gsimplecal # Tooltips -tooltip = 0 tooltip_padding = 5 5 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/sample/text_only_2.tint2rc b/sample/text_only_2.tint2rc index 473d311..9c91b28 100644 --- a/sample/text_only_2.tint2rc +++ b/sample/text_only_2.tint2rc @@ -68,6 +68,7 @@ task_background_id = 4 task_active_background_id = 1 task_urgent_background_id = 0 task_iconified_background_id = 4 +task_tooltip = 0 # Task Icons task_icon_asb = 100 -90 -15 @@ -103,7 +104,6 @@ clock_background_id = 1 clock_rclick_command = gsimplecal # Tooltips -tooltip = 0 tooltip_padding = 5 5 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/sample/text_only_3.tint2rc b/sample/text_only_3.tint2rc index b58f54b..fa4b137 100644 --- a/sample/text_only_3.tint2rc +++ b/sample/text_only_3.tint2rc @@ -50,6 +50,7 @@ task_background_id = 0 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 0 +task_tooltip = 0 # Task Icons task_icon_asb = 100 0 0 @@ -81,7 +82,6 @@ clock_padding = 2 0 clock_background_id = 0 # Tooltips -tooltip = 0 tooltip_padding = 2 2 tooltip_show_timeout = 0.5 tooltip_hide_timeout = 1.2 diff --git a/sample/text_only_4.tint2rc b/sample/text_only_4.tint2rc index 6bbd8cd..ce98bd5 100644 --- a/sample/text_only_4.tint2rc +++ b/sample/text_only_4.tint2rc @@ -50,6 +50,7 @@ task_background_id = 1 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 1 +task_tooltip = 0 # Task Icons task_icon_asb = 100 0 0 @@ -74,7 +75,6 @@ systray_icon_size = 16 systray_icon_asb = 100 -100 -15 # Tooltips -tooltip = 0 tooltip_padding = 0 0 tooltip_show_timeout = 0 tooltip_hide_timeout = 0 diff --git a/sample/text_only_5.tint2rc b/sample/text_only_5.tint2rc index ef2ad76..46fa09f 100644 --- a/sample/text_only_5.tint2rc +++ b/sample/text_only_5.tint2rc @@ -56,6 +56,7 @@ task_background_id = 1 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 1 +task_tooltip = 1 # Task Icons task_icon_asb = 50 0 0 @@ -87,7 +88,6 @@ clock_padding = 4 0 clock_background_id = 0 # Tooltips -tooltip = 1 tooltip_padding = 3 3 tooltip_show_timeout = 1.5 tooltip_hide_timeout = 0.3 diff --git a/sample/text_only_6.tint2rc b/sample/text_only_6.tint2rc index 87962c5..b1a3d51 100644 --- a/sample/text_only_6.tint2rc +++ b/sample/text_only_6.tint2rc @@ -56,6 +56,7 @@ task_background_id = 2 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 0 +task_tooltip = 0 # Task Icons task_icon_asb = 100 -90 -15 @@ -80,7 +81,6 @@ systray_icon_size = 18 systray_icon_asb = 100 -70 -15 # Tooltips -tooltip = 0 tooltip_padding = 5 5 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/sample/tint2rc b/sample/tint2rc index d0fafdd..4907799 100644 --- a/sample/tint2rc +++ b/sample/tint2rc @@ -56,6 +56,7 @@ task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 +task_tooltip = 0 # Task Icons task_icon_asb = 70 0 0 @@ -90,7 +91,6 @@ clock_background_id = 0 clock_rclick_command = orage # Tooltips -tooltip = 0 tooltip_padding = 2 2 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 diff --git a/src/config.c b/src/config.c index 4b84e94..ae6fe31 100644 --- a/src/config.c +++ b/src/config.c @@ -557,6 +557,9 @@ void add_entry (char *key, char *value) panel_config.g_task.config_background_mask |= (1<main_win = XCreateWindow(server.dsp, server.root_win, p->posx, p->posy, p->area.width, p->area.height, 0, server.depth, InputOutput, server.visual, mask, &att); long event_mask = ExposureMask|ButtonPressMask|ButtonReleaseMask|ButtonMotionMask; - if (g_tooltip.enabled) + if (p->g_task.tooltip_enabled || p->clock.area._get_tooltip_text) event_mask |= PointerMotionMask|LeaveWindowMask; if (panel_autohide) event_mask |= LeaveWindowMask|EnterWindowMask; diff --git a/src/taskbar/task.c b/src/taskbar/task.c index df4bdbd..e03f69c 100644 --- a/src/taskbar/task.c +++ b/src/taskbar/task.c @@ -96,7 +96,8 @@ Task *add_task (Window win) new_tsk2->area.on_screen = 0; } new_tsk2->title = new_tsk.title; - new_tsk2->area._get_tooltip_text = task_get_tooltip; + if (panel1[monitor].g_task.tooltip_enabled) + new_tsk2->area._get_tooltip_text = task_get_tooltip; for (k=0; kicon[k] = new_tsk.icon[k]; new_tsk2->state_pix[k] = 0; @@ -164,7 +165,7 @@ int get_title(Task *tsk) Panel *panel = tsk->area.panel; char *title, *name; - if (!panel->g_task.text && !g_tooltip.enabled) return 0; + if (!panel->g_task.text && !panel->g_task.tooltip_enabled) return 0; name = server_get_property (tsk->win, server.atom._NET_WM_VISIBLE_NAME, server.atom.UTF8_STRING, 0); if (!name || !strlen(name)) { diff --git a/src/taskbar/task.h b/src/taskbar/task.h index 9fe7896..d701c70 100644 --- a/src/taskbar/task.h +++ b/src/taskbar/task.h @@ -44,6 +44,7 @@ typedef struct { PangoFontDescription *font_desc; Color font[TASK_STATE_COUNT]; int config_font_mask; + int tooltip_enabled; } Global_task; diff --git a/src/tint.c b/src/tint.c index a7016b3..bc915eb 100644 --- a/src/tint.c +++ b/src/tint.c @@ -873,7 +873,6 @@ start: if (e.xmotion.state & button_mask) event_button_motion_notify (&e); - if (!g_tooltip.enabled) break; Panel* panel = get_panel(e.xmotion.window); Area* area = click_area(panel, e.xmotion.x, e.xmotion.y); if (area->_get_tooltip_text) @@ -884,8 +883,7 @@ start: } case LeaveNotify: - if (g_tooltip.enabled) - tooltip_trigger_hide(); + tooltip_trigger_hide(); break; case Expose: diff --git a/src/tooltip/tooltip.h b/src/tooltip/tooltip.h index d575773..c8c5d9b 100644 --- a/src/tooltip/tooltip.h +++ b/src/tooltip/tooltip.h @@ -30,7 +30,6 @@ typedef struct { Window window; int show_timeout_msec; int hide_timeout_msec; - Bool enabled; Bool mapped; int paddingx; int paddingy;