@@ -46,11 +46,6 @@ impl ObjectImpl for PickerGroupBoxInner {
46
46
} ) ;
47
47
SIGNALS . as_ref ( )
48
48
}
49
-
50
- fn constructed ( & self , widget : & Self :: Type ) {
51
- self . parent_constructed ( widget) ;
52
- widget. set_halign ( gtk:: Align :: Center ) ;
53
- }
54
49
}
55
50
56
51
impl WidgetImpl for PickerGroupBoxInner {
@@ -59,24 +54,13 @@ impl WidgetImpl for PickerGroupBoxInner {
59
54
}
60
55
61
56
fn preferred_width ( & self , _widget : & Self :: Type ) -> ( i32 , i32 ) {
62
- let minimum_width = self
57
+ let width = self
63
58
. groups
64
59
. iter ( )
65
60
. map ( |x| x. widget ( ) . preferred_width ( ) . 1 )
66
61
. max ( )
67
62
. unwrap_or ( 0 ) ;
68
- let natural_width = self
69
- . groups
70
- . chunks ( 3 )
71
- . map ( |row| {
72
- row. iter ( )
73
- . map ( |x| x. widget ( ) . preferred_width ( ) . 1 )
74
- . sum :: < i32 > ( )
75
- } )
76
- . max ( )
77
- . unwrap_or ( 0 )
78
- + 2 * HSPACING ;
79
- ( minimum_width, natural_width)
63
+ ( width, width)
80
64
}
81
65
82
66
fn preferred_height_for_width ( & self , widget : & Self :: Type , width : i32 ) -> ( i32 , i32 ) {
@@ -85,34 +69,6 @@ impl WidgetImpl for PickerGroupBoxInner {
85
69
( height, height)
86
70
}
87
71
88
- fn adjust_size_allocation (
89
- & self ,
90
- obj : & Self :: Type ,
91
- orientation : gtk:: Orientation ,
92
- minimum_size : & mut i32 ,
93
- natural_size : & mut i32 ,
94
- allocated_pos : & mut i32 ,
95
- allocated_size : & mut i32 ,
96
- ) {
97
- // For centering to work, adjust natural width to be the portion of
98
- // allocated width that will actually be used after reflowing
99
- // children.
100
- if orientation == gtk:: Orientation :: Horizontal {
101
- let rows = obj. rows_for_width ( * allocated_size) ;
102
- let total_width = max_width_for_rows ( & rows) ;
103
- * natural_size = ( * natural_size) . min ( total_width) ;
104
- }
105
-
106
- self . parent_adjust_size_allocation (
107
- obj,
108
- orientation,
109
- minimum_size,
110
- natural_size,
111
- allocated_pos,
112
- allocated_size,
113
- ) ;
114
- }
115
-
116
72
fn size_allocate ( & self , obj : & Self :: Type , allocation : & gtk:: Allocation ) {
117
73
self . parent_size_allocate ( obj, allocation) ;
118
74
0 commit comments