Skip to content

Commit 5fbf355

Browse files
committed
code style
1 parent f49db24 commit 5fbf355

File tree

1 file changed

+50
-56
lines changed

1 file changed

+50
-56
lines changed

src/Widgets/Browser.vala

+50-56
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*-
22
* Copyright (c) 2015 Erasmo Marín <[email protected]>
3-
* Copyright (c) 2017-2017 Artem Anufrij <[email protected]>
3+
* Copyright (c) 2017-2018 Artem Anufrij <[email protected]>
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -108,65 +108,59 @@ namespace Webpin.Widgets {
108108
}
109109
container.pack_start (icon, true, true, 0);
110110

111-
web_view.create.connect (
112-
(action) => {
113-
app_notification.title = _ ("Open request in an external application…");
114-
app_notification.send_notification ();
115-
116-
external_request (action);
117-
return new WebKit.WebView ();
118-
});
119-
120-
web_view.load_changed.connect (
121-
(load_event) => {
122-
request_begin ();
123-
if (load_event == WebKit.LoadEvent.FINISHED) {
124-
visible_child_name = "app";
125-
if (app_notification.reveal_child) {
126-
app_notification.reveal_child = false;
127-
}
128-
request_finished ();
111+
web_view.create.connect ((action) => {
112+
app_notification.title = _ ("Open request in an external application…");
113+
app_notification.send_notification ();
114+
115+
external_request (action);
116+
return new WebKit.WebView ();
117+
});
118+
119+
web_view.load_changed.connect ((load_event) => {
120+
request_begin ();
121+
if (load_event == WebKit.LoadEvent.FINISHED) {
122+
visible_child_name = "app";
123+
if (app_notification.reveal_child) {
124+
app_notification.reveal_child = false;
129125
}
130-
});
126+
request_finished ();
127+
}
128+
});
129+
130+
web_view.show_notification.connect ((notification) => {
131+
desktop_notification (notification.title, notification.body, icon_for_notification);
132+
return true;
133+
});
131134

132-
web_view.show_notification.connect (
133-
(notification) => {
134-
desktop_notification (notification.title, notification.body, icon_for_notification);
135+
web_view.permission_request.connect ((permission) => {
136+
var permission_type = permission as WebKit.NotificationPermissionRequest;
137+
if (permission_type != null) {
138+
permission_type.allow ();
139+
}
140+
return false;
141+
});
142+
143+
web_view.button_press_event.connect ((event) => {
144+
if (event.button == 8) {
145+
web_view.go_back ();
146+
return true;
147+
} else if (event.button == 9) {
148+
web_view.go_forward ();
135149
return true;
136-
});
150+
}
151+
return base.button_press_event (event);
152+
});
137153

138-
web_view.permission_request.connect (
139-
(permission) => {
140-
var permission_type = permission as WebKit.NotificationPermissionRequest;
141-
if (permission_type != null) {
142-
permission_type.allow ();
143-
}
144-
return false;
145-
});
146-
147-
web_view.button_press_event.connect (
148-
(event) => {
149-
if (event.button == 8) {
150-
web_view.go_back ();
151-
return true;
152-
} else if (event.button == 9) {
153-
web_view.go_forward ();
154-
return true;
155-
}
156-
return base.button_press_event (event);
157-
});
158-
159-
web_view.key_press_event.connect (
160-
(event) => {
161-
if (event.keyval == Gdk.Key.Back) {
162-
web_view.go_back ();
163-
return true;
164-
} else if (event.keyval == Gdk.Key.Forward) {
165-
web_view.go_forward ();
166-
return true;
167-
}
168-
return base.key_press_event (event);
169-
});
154+
web_view.key_press_event.connect ((event) => {
155+
if (event.keyval == Gdk.Key.Back) {
156+
web_view.go_back ();
157+
return true;
158+
} else if (event.keyval == Gdk.Key.Forward) {
159+
web_view.go_forward ();
160+
return true;
161+
}
162+
return base.key_press_event (event);
163+
});
170164
}
171165

172166
public void go_home () {

0 commit comments

Comments
 (0)