~ubuntu-branches/ubuntu/utopic/cairo-dock-plug-ins/utopic

« back to all changes in this revision

Viewing changes to dialog-rendering/src/applet-decorator-tooltip.c

  • Committer: Matthieu Baerts
  • Date: 2013-10-04 13:11:52 UTC
  • mfrom: (1.1.33)
  • Revision ID: matttbe@gmail.com-20131004131152-lig9ijrvkc0g00w6
Tags: 3.3.0-0ubuntu1
* New upstream release.
* Detailed Upstream ChangeLog (beta 2 -> release)
  - Dbus: don't notify of startup if the applet is already controling a
    window
  - Dialogs: tooltip view: fixed the position of the widget inside the
    dialog when it's placed on top of the screen
  - Folder: watch for drop events onto the docks only
  - GMenu:
    - Apps: set the desktop environment to correctly exclude apps
    - Search: When there is no result, display 'Launch this command'
    - Search: launch app: do not restrict to the left click
    - Search: match: display name: locate a substring instead of compare
      the first chars
  - Indicator-Generic: forced the 'data' to be a GldiModuleInstance
  - logout: select shutdown menu item: do not create a list and iter all
    menu items, just save the pointer
  - Messaging Menu: Indicator3: detach the icon at startup: the icon is
    inserted when the entry will be added
  - Messaging Menu: with old versions of libindicator: fixed tiny memory
    leaks
  - po: updated translations
  - Switcher: correctly update the icon by listening more signals
  - Switcher: fixed the drawing of the desktop name in the desklet when
    it's larger than the desklet
  - Terminal: when dropped something in the terminal, take the data and
    not only the text + give the focus just after
  - All: menu functions have been renamed in libgldi
  - All: remove useless g_print
* Some bugs have been fixed:
  - logout: UPower: invalid fastbin entry LP: #1212981
  - logout: Use logind for suspend/hibernate/poweroff/reboot LP: #1175810
  - keyboard: cairo-dock crashes on keyboard layout swtcher LP: #668061
  - keyboard: Cairo-dock is unable to get CAPS Lock and NumLck values
    LP: #476842
  - quick-browser: Error Message LP: #660261
  - recent-events: Move from zeitgeist-1.0 to zeitgeist-2.0 LP: #1197569
* debian/control: bumped Cairo-Dock (core) version

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#define _CAIRO_DIALOG_TOOLTIP_ARROW_HEIGHT 5
30
30
#define _CAIRO_DIALOG_TOOLTIP_MARGIN 4
31
31
 
 
32
/*
 
33
ic______^___  arrow height + margin
 
34
ic     msg
 
35
 |
 
36
 |   widget
 
37
 |
 
38
 |____________  bottom margin
 
39
 
 
40
*/
32
41
 
33
42
void cd_decorator_set_frame_size_tooltip (CairoDialog *pDialog)
34
43
{
55
64
        double fIconOffset = pDialog->iIconSize / 2;  // myDialogsParam.iDialogIconSize/2
56
65
        
57
66
        double fOffsetX = fRadius + fLineWidth / 2 + fIconOffset;
58
 
        double fOffsetY = (pDialog->container.bDirectionUp ? fLineWidth / 2 : pDialog->container.iHeight - fLineWidth / 2) + (pDialog->container.bDirectionUp ? fIconOffset : -fIconOffset);
 
67
        double fOffsetY = (pDialog->container.bDirectionUp ? fLineWidth / 2 : pDialog->container.iHeight - fLineWidth / 2) + (pDialog->container.bDirectionUp ? fIconOffset : /**-fIconOffset*/ -_CAIRO_DIALOG_TOOLTIP_MARGIN);  // _CAIRO_DIALOG_TOOLTIP_MARGIN is to compensate for the slightly different placement of top dialogs
59
68
        int sens = (pDialog->container.bDirectionUp ? 1 : -1);
60
69
        int iWidth = pDialog->container.iWidth - fIconOffset;
61
70
        
82
91
        else
83
92
                iArrowShift = 0;
84
93
        
 
94
        int h = pDialog->iBubbleHeight + pDialog->iTopMargin + pDialog->iBottomMargin - (2 * fRadius + fLineWidth);
 
95
        if (pDialog->container.bDirectionUp)
 
96
                h -= fIconOffset;
 
97
        else
 
98
                h -= _CAIRO_DIALOG_TOOLTIP_MARGIN;
 
99
        
85
100
        //On se déplace la ou il le faut
86
101
        cairo_move_to (pCairoContext, fOffsetX, fOffsetY);
87
102
        
95
110
                fRadius, sens * fRadius);
96
111
        
97
112
        // Ligne droite. (Haut droit -> Bas droit)
98
 
        cairo_rel_line_to (pCairoContext, 0, sens *     (pDialog->iBubbleHeight + pDialog->iTopMargin + pDialog->iBottomMargin - (2 * fRadius + fLineWidth + fIconOffset)));
 
113
        cairo_rel_line_to (pCairoContext, 0, sens * h);
99
114
        
100
115
        // Coin bas droit.
101
116
        cairo_rel_curve_to (pCairoContext,
122
137
                -fRadius, -sens * fRadius);
123
138
        
124
139
        // On remonte.
125
 
        cairo_rel_line_to (pCairoContext, 0, - sens * (pDialog->iBubbleHeight + pDialog->iTopMargin + pDialog->iBottomMargin - (2 * fRadius + fLineWidth + fIconOffset)));
 
140
        cairo_rel_line_to (pCairoContext, 0, - sens * h);
126
141
        
127
142
        // Coin haut gauche.
128
143
        cairo_rel_curve_to (pCairoContext,