~ubuntu-branches/ubuntu/trusty/gnome-do/trusty

« back to all changes in this revision

Viewing changes to Do.Interface.Linux/src/Do.Interface/PositionWindow.cs

  • Committer: Package Import Robot
  • Author(s): Christopher James Halse Rogers
  • Date: 2012-03-26 11:12:21 UTC
  • mfrom: (0.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120326111221-1jk143fy37zxi3e4
Tags: 0.9-1
* New upstream version no longer uses deprecated internal glib headers.
  (Closes: #665537)
* [59fa37b9] Fix watch file
* [63486516] Imported Upstream version 0.9
* [8c636d84] Disable testsuite for now; requires running dbus and gconf daemons
* [e46de4b9] Remove inaccurate README.Source
* [4591d677] Add git-buildpackage configuration to default to pristine-tar

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                {
55
55
                        UpdatePosition (iconboxWidth, currentPane, resultsOffset, new Gdk.Rectangle ());
56
56
                }
57
 
                
 
57
 
 
58
                protected Rectangle CalculateBasePosition (Rectangle screen, Rectangle window, Rectangle offset)
 
59
                {
 
60
                        Rectangle result = window;
 
61
 
 
62
                        result.X = ((screen.Width - window.Width) / 2) + screen.X + offset.X;
 
63
                        result.Y = (int)((screen.Height - window.Height) / 2.5) + screen.Y + offset.Y;
 
64
 
 
65
                        return result;
 
66
                }
 
67
 
58
68
                public void UpdatePosition (int iconboxWidth, Pane currentPane, Rectangle resultsOffset, Rectangle normalOffset) {
59
69
                        Gtk.Application.Invoke (delegate {
60
70
                                Gdk.Rectangle geo, main, results;
63
73
                                w.GetSize (out main.Width, out main.Height);
64
74
                        
65
75
                                geo = w.Screen.GetMonitorGeometry (GetMonitor ());
66
 
                                main.X = ((geo.Width - main.Width) / 2) + geo.X + normalOffset.X;
67
 
                                main.Y = (int)((geo.Height + geo.Y - main.Height) / 2.5) + geo.Y + normalOffset.Y;
 
76
                                main = CalculateBasePosition (geo, main, normalOffset);
68
77
                                w.Move (main.X, main.Y);
69
78
                                
70
79
                                if (r == null) return;