attach scrollbar and layout to the same adjustment so it need not be done in code
This commit is contained in:
parent
a6995849d2
commit
d6f9ae3793
|
@ -10,6 +10,9 @@
|
|||
<object class="GtkLayout" id="layout">
|
||||
<property name="visible">True</property>
|
||||
<property name="app_paintable">True</property>
|
||||
<property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK</property>
|
||||
<property name="hadjustment">layouthadjustment</property>
|
||||
<property name="vadjustment">layoutvadjustment</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -47,6 +50,7 @@
|
|||
<child>
|
||||
<object class="GtkHScrollbar" id="hscrollbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="adjustment">layouthadjustment</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
|
@ -64,6 +68,7 @@
|
|||
<object class="GtkVScrollbar" id="vscrollbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">layoutvadjustment</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -72,4 +77,16 @@
|
|||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="layouthadjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
<property name="page_size">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="layoutvadjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
<property name="page_size">10</property>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<object class="GtkAdjustment" id="layoutvadjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="loyouthadjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkGrid" id="tabContents">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -11,6 +21,9 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="app_paintable">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK</property>
|
||||
<property name="hadjustment">loyouthadjustment</property>
|
||||
<property name="vadjustment">layoutvadjustment</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
@ -25,6 +38,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">layoutvadjustment</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -69,6 +83,7 @@
|
|||
<object class="GtkScrollbar" id="hscrollbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="adjustment">loyouthadjustment</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
|
|
10
gtk/window.c
10
gtk/window.c
|
@ -673,14 +673,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
|
|||
g->status_bar = GTK_LABEL(gtk_builder_get_object(xml, "status_bar"));
|
||||
g->paned = GTK_PANED(gtk_builder_get_object(xml, "hpaned1"));
|
||||
|
||||
/* connect the scrollbars to the layout widget */
|
||||
nsgtk_layout_set_hadjustment(g->layout,
|
||||
gtk_range_get_adjustment(GTK_RANGE(
|
||||
gtk_builder_get_object(xml, "hscrollbar"))));
|
||||
nsgtk_layout_set_vadjustment(g->layout,
|
||||
gtk_range_get_adjustment(GTK_RANGE(
|
||||
gtk_builder_get_object(xml, "vscrollbar"))));
|
||||
|
||||
/* add the tab to the scaffold */
|
||||
bool tempback = true;
|
||||
switch (temp_open_background) {
|
||||
|
@ -744,7 +736,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
|
|||
nsgtk_window_keypress_event, g);
|
||||
CONNECT(g->layout, "size_allocate",
|
||||
nsgtk_window_size_allocate_event, g);
|
||||
CONNECT(g->layout, "scroll_event",
|
||||
CONNECT(g->layout, "scroll-event",
|
||||
nsgtk_window_scroll_event, g);
|
||||
return g;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue