~gala-dev/gala/tiling-plugin

« back to all changes in this revision

Viewing changes to src/Widgets/WorkspaceThumb.vala

  • Committer: Tarmac
  • Author(s): Tom Beckmann
  • Date: 2013-08-09 19:00:29 UTC
  • mfrom: (346.1.4 close-button-placement)
  • Revision ID: tarmac-20130809190029-ivf0wtbkhhwu34r8
workspacethumb, windowthumb: place close button according to button-layout key

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
                        try {
104
104
                                close_button.set_from_pixbuf (Granite.Widgets.Utils.get_close_pixbuf ());
105
105
                        } catch (Error e) { warning (e.message); }
106
 
                        close_button.x = -12.0f;
107
 
                        close_button.y = -10.0f;
 
106
                        close_button.y = -close_button.height * 0.25f;
108
107
                        close_button.reactive = true;
109
108
                        close_button.scale_gravity = Clutter.Gravity.CENTER;
110
109
                        close_button.scale_x = 0;
206
205
                        wallpaper.width = width;
207
206
                        windows.width = width;
208
207
 
 
208
                        Granite.CloseButtonPosition pos;
 
209
                        Granite.Widgets.Utils.get_default_close_button_position (out pos);
 
210
                        float close_button_offset = close_button.width * 0.25f;
 
211
                        switch (pos) {
 
212
                                case Granite.CloseButtonPosition.LEFT:
 
213
                                        close_button.x = -close_button_offset;
 
214
                                        break;
 
215
                                case Granite.CloseButtonPosition.RIGHT:
 
216
                                        close_button.x = width - close_button_offset;
 
217
                                        break;
 
218
                        }
 
219
 
209
220
                        plus.x = wallpaper.x + wallpaper.width / 2 - plus.width / 2;
210
221
                        plus.y = wallpaper.y + wallpaper.height / 2 - plus.height / 2;
211
222