adjust tooltip position (mrovi)
git-svn-id: http://tint2.googlecode.com/svn/trunk@524 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -31,10 +31,21 @@
|
||||
#include "panel.h"
|
||||
|
||||
|
||||
// 1) resize child
|
||||
// 2) resize parent
|
||||
// 3) redraw parent
|
||||
// 4) redraw child
|
||||
/*
|
||||
// TODO : layering & drawing loop
|
||||
1) browse tree and calculate 'size' for SIZE_BY_CONTENT
|
||||
- SIZE_BY_CONTENT loop calculate child first
|
||||
- if 'size' changed then 'resize = 1' on the parent (tester resize aprés la boucle)
|
||||
- size == width on horizontal panel and == height on vertical panel
|
||||
2) browse tree and calculate 'size' for SIZE_BY_LAYOUT
|
||||
- SIZE_BY_LAYOUT loop calculate parent first
|
||||
- if 'size' changed then 'resize = 1' on childs with SIZE_BY_LAYOUT
|
||||
- calculate width = size - somme(child_with_of_SIZE_BY_CONTENT) modulo(number of child_SIZE_BY_LAYOUT)
|
||||
- calculate modulo =
|
||||
3) calculate posx of all objects
|
||||
4) redraw needed objects
|
||||
*/
|
||||
|
||||
void refresh (Area *a)
|
||||
{
|
||||
// don't draw and resize hide objects
|
||||
@@ -137,9 +148,9 @@ void draw_background (Area *a, cairo_t *c)
|
||||
draw_rect(c, a->bg->border.width/2.0, a->bg->border.width/2.0, a->width - a->bg->border.width, a->height - a->bg->border.width, a->bg->border.rounded);
|
||||
/*
|
||||
// convert : radian = degre * M_PI/180
|
||||
// définir le dégradé dans un carré de (0,0) (100,100)
|
||||
// ensuite ce dégradé est extrapolé selon le ratio width/height
|
||||
// dans repère (0, 0) (100, 100)
|
||||
// définir le dégradé dans un carré de (0,0) (100,100)
|
||||
// ensuite ce dégradé est extrapolé selon le ratio width/height
|
||||
// dans repère (0, 0) (100, 100)
|
||||
double X0, Y0, X1, Y1, degre;
|
||||
// x = X * (a->width / 100), y = Y * (a->height / 100)
|
||||
double x0, y0, x1, y1;
|
||||
@@ -148,13 +159,13 @@ void draw_background (Area *a, cairo_t *c)
|
||||
X1 = 100;
|
||||
Y1 = 0;
|
||||
degre = 45;
|
||||
// et ensuite faire la changement d'unité du repère
|
||||
// car ce qui doit resté inchangée est les traits et pas la direction
|
||||
// et ensuite faire la changement d'unité du repère
|
||||
// car ce qui doit resté inchangée est les traits et pas la direction
|
||||
|
||||
// il faut d'abord appliquer une rotation de 90° (et -180° si l'angle est supérieur à 180°)
|
||||
// ceci peut être appliqué une fois pour toute au départ
|
||||
// ensuite calculer l'angle dans le nouveau repère
|
||||
// puis faire une rotation de 90°
|
||||
// il faut d'abord appliquer une rotation de 90° (et -180° si l'angle est supérieur à 180°)
|
||||
// ceci peut être appliqué une fois pour toute au départ
|
||||
// ensuite calculer l'angle dans le nouveau repère
|
||||
// puis faire une rotation de 90°
|
||||
x0 = X0 * ((double)a->width / 100);
|
||||
x1 = X1 * ((double)a->width / 100);
|
||||
y0 = Y0 * ((double)a->height / 100);
|
||||
|
||||
@@ -47,6 +47,10 @@ typedef struct
|
||||
} Background;
|
||||
|
||||
|
||||
// way to calculate the size
|
||||
// SIZE_BY_LAYOUT objects : taskbar and task
|
||||
// SIZE_BY_CONTENT objects : clock, battery, launcher, systray
|
||||
enum { SIZE_BY_LAYOUT, SIZE_BY_CONTENT };
|
||||
|
||||
typedef struct {
|
||||
// coordinate relative to panel window
|
||||
@@ -59,8 +63,11 @@ typedef struct {
|
||||
// list of child : Area object
|
||||
GSList *list;
|
||||
|
||||
// object visible on screen
|
||||
int on_screen;
|
||||
// need compute position and width
|
||||
// way to calculate the size (SIZE_BY_CONTENT or SIZE_BY_LAYOUT)
|
||||
int size_mode;
|
||||
// need to calculate position and width
|
||||
int resize;
|
||||
// need redraw Pixmap
|
||||
int redraw;
|
||||
|
||||
Reference in New Issue
Block a user