Switch the layout when the screen geometry changes
authorPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 2 Jun 2010 19:00:51 +0000 (21:00 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 2 Jun 2010 19:00:51 +0000 (21:00 +0200)
src/lift-detail-window.vala
src/lift-list-window.vala

index 346b1fc..e519fda 100644 (file)
@@ -150,7 +150,7 @@ public class LiftDetailWindow : StackableWindow {
                button_email.hide ();
                add (alignment);
 
-               BeifahrerProgram.orientation.changed.connect (on_orientation_changed);
+               Gdk.Screen.get_default ().size_changed.connect (on_orientation_changed);
                add_contact.clicked.connect (on_add_contact_clicked);
                goto_website.clicked.connect (on_goto_website_clicked);
                image_eventbox.button_press_event.connect (on_image_eventbox_button_pressed);
@@ -371,7 +371,7 @@ public class LiftDetailWindow : StackableWindow {
                return false;
        }
 
-       void on_orientation_changed () {
+       void on_orientation_changed (Gdk.Screen screen) {
                // Maybe this will be fixed directly in Maemo-GTK, see
                // http://lists.maemo.org/pipermail/maemo-developers/2010-May/026332.html
                vbox.queue_resize ();
index 82e731e..4e82d9a 100644 (file)
@@ -112,7 +112,7 @@ public class LiftListWindow : StackableWindow {
                route_column.set_visible (!BeifahrerProgram.orientation.portrait);
 
                tree.row_activated.connect (this.on_row_activated);
-               BeifahrerProgram.orientation.changed.connect (this.on_orientation_changed);
+               Gdk.Screen.get_default ().size_changed.connect (this.on_orientation_changed);
        }
 
        public async void find_lifts (string city_from, int radius_from, string city_to, int radius_to, Date date, int tolerance = 0) {
@@ -177,7 +177,7 @@ public class LiftListWindow : StackableWindow {
                }
        }
 
-       private void on_orientation_changed () {
+       private void on_orientation_changed (Gdk.Screen screen) {
                route_column.set_visible (!BeifahrerProgram.orientation.portrait);
        }
 }