1
1
# window.py
2
2
#
3
- # Copyright 2022 Gradience Team
3
+ # Change the look of Adwaita, with ease
4
+ # Copyright (C) 2022 Gradience Team
4
5
#
5
- # Permission is hereby granted, free of charge, to any person obtaining
6
- # a copy of this software and associated documentation files (the
7
- # "Software"), to deal in the Software without restriction, including
8
- # without limitation the rights to use, copy, modify, merge, publish,
9
- # distribute, sublicense, and/or sell copies of the Software, and to
10
- # permit persons to whom the Software is furnished to do so, subject to
11
- # the following conditions:
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
12
10
#
13
- # The above copyright notice and this permission notice shall be
14
- # included in all copies or substantial portions of the Software.
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
15
#
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+
16
19
17
20
import os
18
21
@@ -90,19 +93,24 @@ def __init__(self, **kwargs):
90
93
91
94
self .get_default_wallpaper ()
92
95
96
+ # FIXME: This function works only when build using meson, because Flatpak can't access host's dconf with current config/impl
93
97
def get_default_wallpaper (self ):
94
98
background_settings = Gio .Settings ("org.gnome.desktop.background" )
95
99
if self .style_manager .get_dark ():
96
- self . monet_image_file = background_settings .get_string (
100
+ picture_uri = background_settings .get_string (
97
101
"picture-uri-dark" )
98
102
else :
99
- self .monet_image_file = background_settings .get_string (
100
- "picture-uri-dark" )
101
- self .monet_image_file = Gio .File .new_for_uri (self .monet_image_file )
103
+ picture_uri = background_settings .get_string (
104
+ "picture-uri" )
105
+ buglog (picture_uri )
106
+ self .monet_image_file = Gio .File .new_for_uri (picture_uri )
102
107
image_basename = self .monet_image_file .get_basename ()
108
+ buglog (image_basename )
103
109
self .monet_file_chooser_button .set_label (image_basename )
104
110
self .monet_image_file = self .monet_image_file .get_path ()
105
- self .on_apply_button ()
111
+ self .monet_file_chooser_button .set_tooltip_text (self .monet_image_file )
112
+ buglog (self .monet_image_file )
113
+ #self.on_apply_button() # Comment out for now, because it always shows that annoying toast on startup
106
114
107
115
def on_file_picker_button_clicked (self , * args ):
108
116
self .monet_file_chooser_dialog .show ()
@@ -116,6 +124,7 @@ def on_monet_file_chooser_response(self, widget, response):
116
124
self .monet_image_file = self .monet_file_chooser_dialog .get_file ()
117
125
image_basename = self .monet_image_file .get_basename ()
118
126
self .monet_file_chooser_button .set_label (image_basename )
127
+ self .monet_file_chooser_button .set_tooltip_text (self .monet_image_file )
119
128
self .monet_file_chooser_dialog .hide ()
120
129
121
130
if response == Gtk .ResponseType .ACCEPT :
0 commit comments