GTG

Merge lp:~parinporecha/gtg/calendar_hidden_patch into lp:~gtg/gtg/old-trunk

Proposed by Parin Porecha
Status: Merged
Merged at revision: 1269
Proposed branch: lp:~parinporecha/gtg/calendar_hidden_patch
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 32 lines (+12/-2)
1 file modified
GTG/gtk/editor/calendar.py (+12/-2)
To merge this branch: bzr merge lp:~parinporecha/gtg/calendar_hidden_patch
Reviewer Review Type Date Requested Status
Izidor Matušov Approve
Review via email: mp+141557@code.launchpad.net

Description of the change

This is a patch for the Bug #1032745 ( Hidden part of calendar ) and Bug #1096622 ( Damaged image in the help ).
i have tested it and it works well.
i have used some 'if' statements to correct the bug and i'm not sure if this is the best way.
If you do know a better way, plz suggest ! :)
Also, i have left 2 px on both sides for better aesthetics

To post a comment you must log in.
1269. By Parin Porecha

Modified the calendar_hidden_patch. Also, fixed the Bug #1096622

1270. By Parin Porecha

Modified the calendar_hidden_patch. Also, fixed the Bug #1096622

Revision history for this message
Parin Porecha (parinporecha) wrote :

I have modified the patch and put all the new logic in a single method :)
Also, the Bug #1096622 ( Damaged image in the help ) has been fixed

Revision history for this message
Izidor Matušov (izidor) wrote :

Thank you for patches!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/gtk/editor/calendar.py'
2--- GTG/gtk/editor/calendar.py 2012-12-13 15:44:18 +0000
3+++ GTG/gtk/editor/calendar.py 2013-01-08 10:58:21 +0000
4@@ -100,13 +100,23 @@
5 # to let PyGTK solve it's bussiness.
6 self.__calendar.clear_marks()
7
8+ def move_calendar_inside(self, width, height, x, y):
9+ """ This method moves the calender inside the screen whenever part of it is displayed outside the screen """
10+ screen_width = gtk.gdk.screen_width()
11+ if x < width: #To display calendar inside the screen when editor window is outside leftside of the screen
12+ self.__window.move(2, y - height)
13+ elif x > (screen_width-2): #To display calendar inside the screen when editor window is outside rightside of the screen
14+ self.__window.move(screen_width - width - 2, y - height)
15+ else:
16+ self.__window.move(x - width, y - height)
17+
18 def show_at_position(self, x, y):
19 width, height = self.__window.get_size()
20- self.__window.move(x - width, y - height)
21+ self.move_calendar_inside(width, height, x, y)
22 self.__window.show()
23 ##some window managers ignore move before you show a window. (which
24 # ones? question by invernizzi)
25- self.__window.move(x - width, y - height)
26+ self.move_calendar_inside(width, height, x, y)
27 self.__window.grab_add()
28 #We grab the pointer in the calendar
29 gdk.pointer_grab(self.__window.window, True,
30
31=== modified file 'doc/userdoc/C/figures/quick_tag_entry.png'
32Binary files doc/userdoc/C/figures/quick_tag_entry.png 2012-07-09 15:18:39 +0000 and doc/userdoc/C/figures/quick_tag_entry.png 2013-01-08 10:58:21 +0000 differ

Subscribers

People subscribed via source and target branches

to status/vote changes: