revert rev 541 : we don t need to duplicate x,y
git-svn-id: http://tint2.googlecode.com/svn/trunk@543 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
#include "panel.h"
|
#include "panel.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
static int x_original, y_original, x, y, width, height;
|
static int x, y, width, height;
|
||||||
|
|
||||||
// the next functions are helper functions for tooltip handling
|
// the next functions are helper functions for tooltip handling
|
||||||
void start_show_timeout();
|
void start_show_timeout();
|
||||||
@@ -78,8 +78,10 @@ void init_tooltip()
|
|||||||
void tooltip_trigger_show(Area* area, Panel* p, XEvent *e)
|
void tooltip_trigger_show(Area* area, Panel* p, XEvent *e)
|
||||||
{
|
{
|
||||||
// Position the tooltip in the center of the area
|
// Position the tooltip in the center of the area
|
||||||
x = x_original = area->posx + area->width / 2 + e->xmotion.x_root - e->xmotion.x;
|
x = area->posx + area->width / 2 + e->xmotion.x_root - e->xmotion.x;
|
||||||
y = y_original = area->posy + area->height / 2 + e->xmotion.y_root - e->xmotion.y;
|
y = area->posy + area->height / 2 + e->xmotion.y_root - e->xmotion.y;
|
||||||
|
if (!panel_horizontal)
|
||||||
|
y -= height/2;
|
||||||
g_tooltip.panel = p;
|
g_tooltip.panel = p;
|
||||||
if (g_tooltip.mapped && g_tooltip.area != area) {
|
if (g_tooltip.mapped && g_tooltip.area != area) {
|
||||||
tooltip_copy_text(area);
|
tooltip_copy_text(area);
|
||||||
@@ -124,9 +126,6 @@ void tooltip_update_geometry()
|
|||||||
width = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingx + r2.width;
|
width = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingx + r2.width;
|
||||||
height = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingy + r2.height;
|
height = 2*g_tooltip.bg->border.width + 2*g_tooltip.paddingy + r2.height;
|
||||||
|
|
||||||
x = x_original;
|
|
||||||
y = y_original;
|
|
||||||
|
|
||||||
Panel* panel = g_tooltip.panel;
|
Panel* panel = g_tooltip.panel;
|
||||||
if (panel_horizontal && panel_position & BOTTOM)
|
if (panel_horizontal && panel_position & BOTTOM)
|
||||||
y = panel->posy-height;
|
y = panel->posy-height;
|
||||||
@@ -137,9 +136,6 @@ void tooltip_update_geometry()
|
|||||||
else
|
else
|
||||||
x = panel->posx - width;
|
x = panel->posx - width;
|
||||||
|
|
||||||
if (!panel_horizontal)
|
|
||||||
y -= height/2;
|
|
||||||
|
|
||||||
g_object_unref(layout);
|
g_object_unref(layout);
|
||||||
cairo_destroy(c);
|
cairo_destroy(c);
|
||||||
cairo_surface_destroy(cs);
|
cairo_surface_destroy(cs);
|
||||||
|
|||||||
@@ -56,13 +56,12 @@
|
|||||||
* or from a layering event (size or position change).
|
* or from a layering event (size or position change).
|
||||||
*
|
*
|
||||||
* DRAWING LOOP :
|
* DRAWING LOOP :
|
||||||
*
|
|
||||||
* 1) browse tree and resize SIZE_BY_CONTENT node
|
* 1) browse tree and resize SIZE_BY_CONTENT node
|
||||||
* - children node are resized before its parent
|
* - children node are resized before its parent
|
||||||
* - if 'size' changed then 'resize = 1' on the parent
|
* - if 'size' changed then 'redraw = 1' and 'resize = 1' on the parent
|
||||||
* 2) browse tree and resize SIZE_BY_LAYOUT node
|
* 2) browse tree and resize SIZE_BY_LAYOUT node
|
||||||
* - parent node is resized before its children
|
* - parent node is resized before its children
|
||||||
* - if 'size' changed then 'resize = 1' on childs with SIZE_BY_LAYOUT
|
* - if 'size' changed then 'redraw = 1' and 'resize = 1' on childs with SIZE_BY_LAYOUT
|
||||||
* 3) calculate posx of objects
|
* 3) calculate posx of objects
|
||||||
* - parent's position is calculated before children's position
|
* - parent's position is calculated before children's position
|
||||||
* - if 'position' changed then 'redraw = 1'
|
* - if 'position' changed then 'redraw = 1'
|
||||||
@@ -70,6 +69,10 @@
|
|||||||
* - parent node is drawn before its children
|
* - parent node is drawn before its children
|
||||||
*
|
*
|
||||||
* perhaps 2) and 3) can be merged...
|
* perhaps 2) and 3) can be merged...
|
||||||
|
* répartition entre niveau global et niveau local ??
|
||||||
|
* size_by_content peut-il modifier redraw=1 en cas de changement ? ou est ce géré par chaque composant ?
|
||||||
|
* size_by_layout peut-il modifier redraw ?
|
||||||
|
*
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
|
|
||||||
@@ -118,6 +121,7 @@ void size_by_content (Area *a)
|
|||||||
// if 'size' changed then 'resize = 1' on the parent
|
// if 'size' changed then 'resize = 1' on the parent
|
||||||
if (a->_resize) {
|
if (a->_resize) {
|
||||||
a->_resize(a);
|
a->_resize(a);
|
||||||
|
a->redraw = 1;
|
||||||
((Area*)a->parent)->resize = 1;
|
((Area*)a->parent)->resize = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user