=== modified file 'debian/changelog' --- debian/changelog 2008-04-24 10:25:51 +0000 +++ debian/changelog 2008-04-24 17:22:42 +0000 @@ -1,9 +1,17 @@ ubiquity (1.9.0) UNRELEASED; urgency=low + [ Colin Watson ] * Fix ownership of /home/oem/Desktop in OEM installations (LP: #209683). * Silence deprecation warning in zoommap. - -- Colin Watson Wed, 23 Apr 2008 22:22:52 +0100 + [ Evan Dandrea ] + * Usability fixes for the timezone widget: + - Make the hover-to-zoom areas relative to the widget size. + - Zoom in on the location of the cursor, not the edge relative to its + position. + - Add a delay for zooming out. + + -- Evan Dandrea Thu, 24 Apr 2008 13:11:05 -0400 ubiquity (1.8.7) hardy; urgency=low === modified file 'ubiquity/zoommap.py' --- ubiquity/zoommap.py 2008-04-24 10:25:51 +0000 +++ ubiquity/zoommap.py 2008-04-24 17:22:42 +0000 @@ -27,8 +27,8 @@ from gtk import gdk import ubiquity.tz -# The width, in pixels, of the hover-to-move areas. -MOTION_AREA = 50 +# The width, in percent of the allocation, of the hover-to-move areas. +MOTION_AREA = 0.12 # The distance, in pixels, to step when moving. MOTION_STEP = 20 @@ -111,6 +111,7 @@ timezone_city_combo.connect("changed", self.city_changed) self.connect("button_release_event", self.button_release) self.motion_notify_id = None + self.leave_notify_id = None self.connect("enter_notify_event", self.enter_event) self.connect("leave_notify_event", self.leave_event) self.connect("map-event", self.mapped) @@ -196,19 +197,19 @@ map_h = self.big_pixbuf.get_height() scrolling = False # right - if w - self.cursor_x < MOTION_AREA and self.start_x > (-map_w + w): + if w - self.cursor_x < int(MOTION_AREA * w) and self.start_x > (-map_w + w): self.start_x = self.start_x - MOTION_STEP scrolling = True # left - elif self.cursor_x < MOTION_AREA and self.start_x < 0: + elif self.cursor_x < int(MOTION_AREA * w) and self.start_x < 0: self.start_x = self.start_x + MOTION_STEP scrolling = True # top - if self.cursor_y < MOTION_AREA and self.start_y < 0: + if self.cursor_y < int(MOTION_AREA * h) and self.start_y < 0: self.start_y = self.start_y + MOTION_STEP scrolling = True # bottom - elif h - self.cursor_y < MOTION_AREA and self.start_y > (-map_h + h): + elif h - self.cursor_y < int(MOTION_AREA * h) and self.start_y > (-map_h + h): self.start_y = self.start_y - MOTION_STEP scrolling = True if scrolling: @@ -237,17 +238,17 @@ else: return False - if self.cursor_x < MOTION_AREA: + if self.cursor_x < int(MOTION_AREA * w): self.start_x = 0 - elif w - self.cursor_x < MOTION_AREA: + elif w - self.cursor_x < int(MOTION_AREA * w): self.start_x = (-map_w + w) else: map_x = 1.0 * self.cursor_x / w * map_w map_x_offset = min(map_w - w / 2.0, max(map_x - w/2.0, 0.0)) - x self.start_x = -map_x_offset - if self.cursor_y < MOTION_AREA: + if self.cursor_y < int(MOTION_AREA * h): self.start_y = 0 - elif h - self.cursor_y < MOTION_AREA: + elif h - self.cursor_y < int(MOTION_AREA * h): self.start_y = (-map_h + h) else: map_y = 1.0 * self.cursor_y / h * map_h @@ -262,10 +263,13 @@ return False def enter_event(self, widget, event): - gobject.timeout_add(500, self.enter_timeout) + if self.leave_notify_id and self.cursor_x: + gobject.source_remove(self.leave_notify_id) + return True + gobject.timeout_add(1000, self.enter_timeout) return True - def leave_event(self, widget, event): + def leave_timeout(self): self.cursor_x = None self.cursor_y = None if self.motion_notify_id is not None: @@ -273,6 +277,10 @@ self.motion_notify_id = None self.redraw_all() + def leave_event(self, widget, event): + self.leave_notify_id = gobject.timeout_add(2000, self.leave_timeout) + return True + def load_pixmap(self, pixmap_filename): try: self.pixbuf = gtk.gdk.pixbuf_new_from_file(pixmap_filename)