port to Adw.Application
Bilal Elmoussaoui
2 years ago
0 | |
.recorder-time-label {
|
1 | |
font-size: 32pt;
|
2 | |
font-weight: 300;
|
3 | |
}
|
4 | |
|
5 | |
@keyframes clocks-blink {
|
6 | |
0% { color: @theme_text_color; }
|
7 | |
100% { color: #FF0000; }
|
8 | |
}
|
9 | |
|
10 | |
.recorder-time-label.paused {
|
11 | |
color: #FF0000;
|
12 | |
animation-name: clocks-blink;
|
13 | |
animation-iteration-count: infinite;
|
14 | |
animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
15 | |
animation-duration: 1s;
|
16 | |
}
|
17 | |
|
18 | |
button.large {
|
19 | |
padding: 12px;
|
20 | |
}
|
21 | |
|
22 | |
list row label.title {
|
23 | |
font-weight: bold;
|
24 | |
}
|
25 | |
|
26 | |
list row label.subtitle {
|
27 | |
font-size: smaller;
|
28 | |
}
|
29 | |
|
30 | |
list row {
|
31 | |
margin-top: 0;
|
32 | |
margin-bottom: 0;
|
33 | |
border-radius: 0;
|
34 | |
}
|
35 | |
|
36 | |
list row:first-child {
|
37 | |
border-top-left-radius: 8px;
|
38 | |
border-top-right-radius: 8px;
|
39 | |
}
|
40 | |
|
41 | |
list row:last-child {
|
42 | |
border-bottom-left-radius: 8px;
|
43 | |
border-bottom-right-radius: 8px;
|
44 | |
}
|
45 | |
|
46 | |
list row:first-child.expanded {
|
47 | |
margin-top:0;
|
48 | |
}
|
49 | |
|
50 | |
list row:last-child.expanded {
|
51 | |
margin-bottom: 0;
|
52 | |
}
|
0 | 0 |
<?xml version="1.0" encoding="UTF-8"?>
|
1 | 1 |
<gresources>
|
2 | 2 |
<gresource prefix="/org/gnome/SoundRecorder">
|
3 | |
<file>application.css</file>
|
|
3 |
<file>style.css</file>
|
4 | 4 |
<file>ui/recorder.ui</file>
|
5 | 5 |
<file>ui/row.ui</file>
|
6 | 6 |
<file>ui/window.ui</file>
|
|
0 |
.recorder-time-label {
|
|
1 |
font-size: 32pt;
|
|
2 |
font-weight: 300;
|
|
3 |
}
|
|
4 |
|
|
5 |
@keyframes clocks-blink {
|
|
6 |
0% { color: @theme_text_color; }
|
|
7 |
100% { color: #FF0000; }
|
|
8 |
}
|
|
9 |
|
|
10 |
.recorder-time-label.paused {
|
|
11 |
color: #FF0000;
|
|
12 |
animation-name: clocks-blink;
|
|
13 |
animation-iteration-count: infinite;
|
|
14 |
animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
|
15 |
animation-duration: 1s;
|
|
16 |
}
|
|
17 |
|
|
18 |
button.large {
|
|
19 |
padding: 12px;
|
|
20 |
}
|
|
21 |
|
|
22 |
list row label.title {
|
|
23 |
font-weight: bold;
|
|
24 |
}
|
|
25 |
|
|
26 |
list row label.subtitle {
|
|
27 |
font-size: smaller;
|
|
28 |
}
|
|
29 |
|
|
30 |
list row {
|
|
31 |
margin-top: 0;
|
|
32 |
margin-bottom: 0;
|
|
33 |
border-radius: 0;
|
|
34 |
}
|
|
35 |
|
|
36 |
list row:first-child {
|
|
37 |
border-top-left-radius: 8px;
|
|
38 |
border-top-right-radius: 8px;
|
|
39 |
}
|
|
40 |
|
|
41 |
list row:last-child {
|
|
42 |
border-bottom-left-radius: 8px;
|
|
43 |
border-bottom-right-radius: 8px;
|
|
44 |
}
|
|
45 |
|
|
46 |
list row:first-child.expanded {
|
|
47 |
margin-top:0;
|
|
48 |
}
|
|
49 |
|
|
50 |
list row:last-child.expanded {
|
|
51 |
margin-bottom: 0;
|
|
52 |
}
|
25 | 25 |
|
26 | 26 |
const { Window } = imports.window;
|
27 | 27 |
|
28 | |
var Application = GObject.registerClass(class Application extends Gtk.Application {
|
|
28 |
var Application = GObject.registerClass(class Application extends Adw.Application {
|
29 | 29 |
_init() {
|
30 | |
super._init({ application_id: pkg.name });
|
|
30 |
super._init({ application_id: pkg.name, resource_base_path: '/org/gnome/SoundRecorder/' });
|
31 | 31 |
GLib.set_application_name(_('Sound Recorder'));
|
32 | 32 |
GLib.set_prgname('gnome-sound-recorder');
|
33 | 33 |
GLib.setenv('PULSE_PROP_media.role', 'production', 1);
|
|
88 | 88 |
log('Sound Recorder (%s)'.format(pkg.name));
|
89 | 89 |
log('Version: %s'.format(pkg.version));
|
90 | 90 |
|
91 | |
let provider = new Gtk.CssProvider();
|
92 | |
provider.load_from_resource('/org/gnome/SoundRecorder/application.css');
|
93 | |
|
94 | |
let display = Gdk.Display.get_default();
|
95 | |
Gtk.StyleContext.add_provider_for_display(display,
|
96 | |
provider,
|
97 | |
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
98 | |
|
99 | |
Gtk.IconTheme.get_for_display(display).add_resource_path('/org/gnome/SoundRecorder/icons/');
|
100 | |
|
101 | |
this.set_resource_base_path('/org/gnome/SoundRecorder/');
|
102 | |
Adw.init();
|
103 | 91 |
Gst.init(null);
|
104 | 92 |
|
105 | 93 |
try {
|