Skip to content

Commit

Permalink
Improved design and added 5 days forecast. Also added wind speed to 3…
Browse files Browse the repository at this point in the history
… hours forecast (#1)
  • Loading branch information
SalaniLeo committed Jun 18, 2023
1 parent d032e1d commit 6de06bb
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 130 deletions.
15 changes: 6 additions & 9 deletions Forecast/App.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, *args, **kwargs):

# sets properties to main page #
self.set_title('Forecast - loading')
self.set_default_size(850, 500)
self.set_default_size(850, 390)

# creates stack containing the pages #
self.stack = Gtk.Stack()
Expand Down Expand Up @@ -131,7 +131,7 @@ def show_about(self, action, param):
dialog = Adw.AboutWindow()
dialog.set_transient_for(application)
dialog.set_application_name('Forecast')
dialog.set_version("0.1.0")
dialog.set_version("0.1.1")
dialog.set_license_type(Gtk.License(Gtk.License.GPL_3_0))
dialog.set_comments("Meteo app made with GTK")
dialog.set_website("https://github.com/SalaniLeo/Forecast")
Expand All @@ -153,7 +153,7 @@ class search_page(Gtk.Box):
def __init__(self, button, window, first, *args, **kwargs):
super().__init__(*args, **kwargs)

self.completion_model = Gtk.ListStore.new([GObject.TYPE_INT, GObject.TYPE_STRING])
self.completion_model = Gtk.ListStore.new([])

self.completion = Gtk.EntryCompletion.new()
self.completion.set_model(model=self.completion_model)
Expand Down Expand Up @@ -229,19 +229,18 @@ def __init__(self, parent, **kwargs):
forecast_opt_page = Adw.PreferencesPage.new()
self.add(page=forecast_opt_page)



# -- background radient -- #
application_preferences = Adw.PreferencesGroup.new()
application_preferences.set_title('App preferences')

# creates option to select gradient background
use_gradient_bg_switch = self.opt_switch(None, "gradient-bg")

use_gradient_bg_row = Adw.ActionRow.new()
use_gradient_bg_row.set_title(title='Use gradient as background')
use_gradient_bg_row.set_subtitle("Applies a gradient based on current weather and time. Requires restart to disable")
use_gradient_bg_row.add_suffix(widget=use_gradient_bg_switch)

# -- units -- #
units = settings.get_string('units')
if units == available_units[0]:
units_list = 0
Expand All @@ -260,8 +259,7 @@ def __init__(self, parent, **kwargs):
units_row.set_subtitle("Select which unit of measurement to use")
units_row.add_suffix(widget=units_choice)



# -- api key -- #
api_preferences = Adw.PreferencesGroup.new()
api_preferences.set_title('Api preferences')

Expand Down Expand Up @@ -332,7 +330,6 @@ def change_state(opt, switch, active, entry):
else:
api_key = entry.get_text() #
entry.remove_css_class(css_class='error') # sets entry to on
print(api_key)

# ---- actions to perform before closing preferences window ---- #
def do_shutdown(self, quit):
Expand Down
Loading

0 comments on commit 6de06bb

Please sign in to comment.