*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)


git-svn-id: http://tint2.googlecode.com/svn/trunk@615 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
Andreas.Fink85
2010-12-12 08:57:51 +00:00
parent 07f48183d7
commit 8201742546
23 changed files with 26 additions and 26 deletions

View File

@@ -557,6 +557,9 @@ void add_entry (char *key, char *value)
panel_config.g_task.config_background_mask |= (1<<status);
if (status == TASK_NORMAL) panel_config.g_task.area.bg = panel_config.g_task.background[TASK_NORMAL];
}
// "tooltip" is deprecated but here for backwards compatibility
else if (strcmp (key, "task_tooltip") == 0 || strcmp(key, "tooltip") == 0)
panel_config.g_task.tooltip_enabled = atoi(value);
/* Systray */
else if (strcmp (key, "systray_padding") == 0) {
@@ -626,8 +629,6 @@ void add_entry (char *key, char *value)
}
/* Tooltip */
else if (strcmp (key, "tooltip") == 0)
g_tooltip.enabled = atoi(value);
else if (strcmp (key, "tooltip_show_timeout") == 0) {
int timeout_msec = 1000*atof(value);
g_tooltip.show_timeout_msec = timeout_msec;

View File

@@ -198,7 +198,7 @@ void init_panel()
p->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;

View File

@@ -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; k<TASK_STATE_COUNT; ++k) {
new_tsk2->icon[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)) {

View File

@@ -44,6 +44,7 @@ typedef struct {
PangoFontDescription *font_desc;
Color font[TASK_STATE_COUNT];
int config_font_mask;
int tooltip_enabled;
} Global_task;

View File

@@ -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:

View File

@@ -30,7 +30,6 @@ typedef struct {
Window window;
int show_timeout_msec;
int hide_timeout_msec;
Bool enabled;
Bool mapped;
int paddingx;
int paddingy;