File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -133,26 +133,27 @@ fn create_button(
133
133
let button = new_icon_button ( label, icon_theme, icon_size) ;
134
134
button. set_widget_name ( name) ;
135
135
136
- let style_context = button. style_context ( ) ;
137
- style_context. add_class ( "item" ) ;
136
+ button. add_class ( "item" ) ;
138
137
139
138
if visibility. is_visible ( ) {
140
- style_context . add_class ( "visible" ) ;
139
+ button . add_class ( "visible" ) ;
141
140
}
142
141
143
142
if visibility. is_focused ( ) {
144
- style_context . add_class ( "focused" ) ;
143
+ button . add_class ( "focused" ) ;
145
144
}
146
145
147
146
if !visibility. is_visible ( ) {
148
- style_context . add_class ( "inactive" ) ;
147
+ button . add_class ( "inactive" ) ;
149
148
}
150
149
151
150
{
152
151
let tx = tx. clone ( ) ;
153
152
let name = name. to_string ( ) ;
154
- button. connect_clicked ( move |_item| {
155
- try_send ! ( tx, name. clone( ) ) ;
153
+ button. connect_clicked ( move |button| {
154
+ if !button. style_context ( ) . has_class ( "focused" ) {
155
+ try_send ! ( tx, name. clone( ) ) ;
156
+ }
156
157
} ) ;
157
158
}
158
159
You can’t perform that action at this time.
0 commit comments