Skip to content

Commit

Permalink
Get better current conditions (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Oct 23, 2023
1 parent ef3ffe7 commit 2cfff9d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ public class MainWindow : Gtk.ApplicationWindow {
enabled_providers = METAR | MET_NO
};

var weather_icon = new Gtk.Image.from_icon_name (weather_info.get_symbolic_icon_name ());
var weather_icon = new Gtk.Image ();
weather_icon.add_css_class ("weather-icon");

var weather_label = new Gtk.Label (weather_info.get_sky ()) {
var weather_label = new Gtk.Label ("") {
halign = Gtk.Align.END,
valign = Gtk.Align.END,
hexpand = true
};
weather_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);

var temp_label = new Gtk.Label (weather_info.get_temp ()) {
var temp_label = new Gtk.Label ("") {
halign = Gtk.Align.START
};
temp_label.add_css_class (Granite.STYLE_CLASS_H1_LABEL);
Expand All @@ -43,7 +43,7 @@ public class MainWindow : Gtk.ApplicationWindow {
tooltip_text = _("Wind")
};

var wind_label = new Gtk.Label (weather_info.get_wind ()) {
var wind_label = new Gtk.Label ("") {
halign = START
};

Expand All @@ -52,7 +52,7 @@ public class MainWindow : Gtk.ApplicationWindow {
tooltip_text = _("Visibility")
};

var visibility_label = new Gtk.Label (weather_info.get_visibility ()) {
var visibility_label = new Gtk.Label ("") {
halign = START
};

Expand All @@ -61,7 +61,7 @@ public class MainWindow : Gtk.ApplicationWindow {
tooltip_text = _("Pressure")
};

var pressure_label = new Gtk.Label (weather_info.get_pressure ()) {
var pressure_label = new Gtk.Label ("") {
halign = START
};

Expand Down Expand Up @@ -131,7 +131,13 @@ public class MainWindow : Gtk.ApplicationWindow {
location_label.label = dgettext ("libgweather-locations", location.get_city_name ());

weather_icon.icon_name = weather_info.get_symbolic_icon_name ();
weather_label.label = dgettext ("libgweather", weather_info.get_sky ());

var conditions = weather_info.get_conditions ();
if (conditions == "-") {
conditions = weather_info.get_sky ();
}

weather_label.label = dgettext ("libgweather", conditions);

double temp;
weather_info.get_value_temp (GWeather.TemperatureUnit.DEFAULT, out temp);
Expand Down

0 comments on commit 2cfff9d

Please sign in to comment.