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

« back to all changes in this revision

Viewing changes to Status-Notifier/src/applet-draw.c

  • Committer: Matthieu Baerts
  • Date: 2011-08-09 19:51:45 UTC
  • mfrom: (1.1.12 upstream)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: matttbe@gmail.com-20110809195145-6t55jtykipujuyn5
* New upstream release. (LP: #823514)
* Upstream (short) ChangeLog:
 - The Power-Manager applet has been rewritten to work on any plateform.
 - Compiz-icon applet has been replaced by Composite-Manager.
 - Improved integration in the XFCE, LXDE and GNOME3 desktop.
 - Logout is now working even if there is no/an unknow session manager.
 - Several new DBus methods lets you interact on the dock more easily.
 - Added the possibility to shutdown/logout with GMenu.
 - Improved Status-Notifier and added its own watcher.
 - Added a new applet: Impulse (still need testing).
 - Fixed a few bugs as usual.
* debian/patches:
 - Removed all patches (they was already unapplied).
* debian/copyright:
 - Updated with new files/directory.
* debian/cairo-dock-plug-ins.install:
 - Added status-notifier-watcher used by Status-Notifier applet.
* debian/control:
 - Updated the version of cairo-dock-[core;data;dev].
 - Bump Standard-Version to 3.9.2.
 - Added fftw3, pulse (Impulse) and upower-glib (Logout)
    as new dependences for the build process.
 - Added indicator-[me;messages] as new recommendations
    for cairo-dock-plug-ins (needed for [Me;Messaging]Menu applets).
 - Removed gawk from the build dependences list (no longer needed).
* cairo-dock-plug-ins package needs to be recompiled (LP: #811579)

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        }
96
96
        
97
97
        // compute the required width and the grid.
98
 
        myData.iNbLines = myConfig.iNbLines;
99
 
        myData.iItemSize = MAX (1, iHeight / myConfig.iNbLines);
100
 
        myData.iNbColumns = ceil ((float)iNbItems / myConfig.iNbLines);  // nb items by line.
101
 
        int w = MAX (w0, myData.iItemSize * myData.iNbColumns);
 
98
        int w;
 
99
        if (myContainer->bIsHorizontal)
 
100
        {
 
101
                myData.iNbLines = myConfig.iNbLines;
 
102
                myData.iItemSize = MAX (1, iHeight / myConfig.iNbLines);
 
103
                myData.iNbColumns = ceil ((float)iNbItems / myConfig.iNbLines);  // nb items by line.
 
104
                w = MAX (w0, myData.iItemSize * myData.iNbColumns);
 
105
        }
 
106
        else
 
107
        {
 
108
                myData.iNbColumns = myConfig.iNbLines;
 
109
                myData.iItemSize = MAX (1, iHeight / myConfig.iNbLines);
 
110
                myData.iNbLines = ceil ((float)iNbItems / myConfig.iNbLines);  // nb items by line.
 
111
                w = MAX (w0, myData.iItemSize * myData.iNbLines);
 
112
        }
102
113
        cd_debug ("=== required width: %d (now: %d)", w, iWidth);
103
114
        
104
115
        // if width has changed, update the icon size.
232
243
        iMouseX = myContainer->iMouseX - myIcon->fDrawX;
233
244
        iMouseY = myContainer->iMouseY - myIcon->fDrawY;
234
245
        
235
 
        iMouseX = iMouseX / fSizeX * iWidth;  // transform to the grid.
236
 
        iMouseY = iMouseY / fSizeY * iHeight;
 
246
        if (myContainer->bIsHorizontal)
 
247
        {
 
248
                iMouseX = iMouseX / fSizeX * iWidth;  // transform to the grid.
 
249
                iMouseY = iMouseY / fSizeY * iHeight;
 
250
        }
 
251
        else
 
252
        {
 
253
                int tmp = iMouseX;
 
254
                iMouseX = iMouseY / fSizeX * iWidth;  // transform to the grid.
 
255
                iMouseY = tmp / fSizeY * iHeight;
 
256
        }
237
257
        
238
258
        // get index on the grid.
239
259
        int x_pad = (iWidth - myData.iItemSize * myData.iNbColumns) / 2;