@@ -134,7 +134,7 @@ impl Surface {
134134 tag_table
135135 }
136136 fn create_tag ( name : & str , config : & crate :: config:: Font ) -> gtk:: TextTag {
137- gtk:: builders :: TextTagBuilder :: new ( )
137+ gtk:: TextTag :: builder ( )
138138 . family ( & config. family )
139139 . weight ( config. weight )
140140 . name ( name)
@@ -182,17 +182,11 @@ pub mod imp {
182182 fn properties ( ) -> & ' static [ glib:: ParamSpec ] {
183183 Self :: derived_properties ( )
184184 }
185- fn set_property (
186- & self ,
187- obj : & Self :: Type ,
188- id : usize ,
189- value : & glib:: Value ,
190- pspec : & glib:: ParamSpec ,
191- ) {
192- Self :: derived_set_property ( self , obj, id, value, pspec) . unwrap ( )
185+ fn set_property ( & self , id : usize , value : & glib:: Value , pspec : & glib:: ParamSpec ) {
186+ Self :: derived_set_property ( self , id, value, pspec)
193187 }
194- fn property ( & self , obj : & Self :: Type , id : usize , pspec : & glib:: ParamSpec ) -> glib:: Value {
195- Self :: derived_property ( self , obj , id, pspec) . unwrap ( )
188+ fn property ( & self , id : usize , pspec : & glib:: ParamSpec ) -> glib:: Value {
189+ Self :: derived_property ( self , id, pspec)
196190 }
197191 fn signals ( ) -> & ' static [ glib:: subclass:: Signal ] {
198192 static SIGNALS : Lazy < Vec < glib:: subclass:: Signal > > = Lazy :: new ( || {
@@ -227,25 +221,21 @@ glib::wrapper! {
227221}
228222impl Default for Hypertext {
229223 fn default ( ) -> Self {
230- glib:: Object :: new ( & [ ] ) . unwrap ( )
224+ glib:: Object :: new ( )
231225 }
232226}
233227impl Hypertext {
234228 pub fn new ( url : String , surface : Surface ) -> Self {
235229 let text_view = surface. text_view . clone ( ) ;
236230
237- let this: Self = glib:: Object :: new ( & [ ] ) . unwrap ( ) ;
231+ let this: Self = glib:: Object :: new ( ) ;
238232 this. imp ( ) . url . replace ( url) ;
239233 this. imp ( ) . surface . replace ( Some ( surface) ) ;
240234
241235 let left_click_ctrl = gtk:: GestureClick :: builder ( ) . button ( 1 ) . build ( ) ;
242236 let right_click_ctrl = gtk:: GestureClick :: builder ( ) . button ( 3 ) . build ( ) ;
243237 let motion_ctrl = gtk:: EventControllerMotion :: new ( ) ;
244238
245- text_view. add_controller ( & left_click_ctrl) ;
246- text_view. add_controller ( & right_click_ctrl) ;
247- text_view. add_controller ( & motion_ctrl) ;
248-
249239 left_click_ctrl. connect_released (
250240 clone ! ( @strong this => @default -panic, move |ctrl, _n_press, x, y| {
251241 if let Err ( e) = this. handle_click( ctrl, x, y) {
@@ -266,6 +256,10 @@ impl Hypertext {
266256 let _ = this. handle_motion( x, y) ;
267257 } ) ) ;
268258
259+ text_view. add_controller ( left_click_ctrl) ;
260+ text_view. add_controller ( right_click_ctrl) ;
261+ text_view. add_controller ( motion_ctrl) ;
262+
269263 this
270264 }
271265 pub fn render < ' e > (
@@ -506,7 +500,7 @@ impl Hypertext {
506500 } ;
507501
508502 imp. hover_url . replace ( link_ref. to_owned ( ) ) ;
509- self . emit_hover_url ( ) ;
503+ self . notify_hover_url ( ) ;
510504 Ok ( ( ) )
511505 }
512506}
0 commit comments