1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | import os |
---|
4 | |
---|
5 | from gi.repository import Gtk |
---|
6 | from sugar3.graphics.iconentry import IconEntry |
---|
7 | |
---|
8 | def set_theme(): |
---|
9 | settings = Gtk.Settings.get_default() |
---|
10 | sugar_theme = 'sugar-72' |
---|
11 | if 'SUGAR_SCALING' in os.environ: |
---|
12 | if os.environ['SUGAR_SCALING'] == '100': |
---|
13 | sugar_theme = 'sugar-100' |
---|
14 | settings.set_property('gtk-theme-name', sugar_theme) |
---|
15 | settings.set_property('gtk-icon-theme-name', 'sugar') |
---|
16 | |
---|
17 | |
---|
18 | def main(): |
---|
19 | window = Gtk.Window() |
---|
20 | |
---|
21 | iconentry = IconEntry() |
---|
22 | iconentry.set_icon_from_name( |
---|
23 | Gtk.EntryIconPosition.PRIMARY, |
---|
24 | 'system-search' |
---|
25 | ) |
---|
26 | |
---|
27 | # set_theme() |
---|
28 | iconentry.set_icon_from_name( |
---|
29 | Gtk.EntryIconPosition.SECONDARY, |
---|
30 | 'system-search' |
---|
31 | ) |
---|
32 | |
---|
33 | |
---|
34 | # iconentry.set_icon_from_name( |
---|
35 | # Gtk.EntryIconPosition.SECONDARY, |
---|
36 | # 'dialog-cancel' |
---|
37 | # ) |
---|
38 | |
---|
39 | # iconentry.add_clear_button() |
---|
40 | |
---|
41 | window.add(iconentry) |
---|
42 | |
---|
43 | window.connect("destroy", Gtk.main_quit) |
---|
44 | window.show_all() |
---|
45 | Gtk.main() |
---|
46 | |
---|
47 | if __name__ == "__main__": |
---|
48 | main() |
---|