diff --git a/src/frontendCardAirPollution.py b/src/frontendCardAirPollution.py index 6bf3a00..0ac672d 100644 --- a/src/frontendCardAirPollution.py +++ b/src/frontendCardAirPollution.py @@ -62,7 +62,7 @@ def create_card(self): info_box.set_margin_top(15) main_val = Gtk.Label(label=self.air_apllution_data["hourly"]["us_aqi"][idx]) - main_val.set_css_classes(["text-l3", "bold"]) + main_val.set_css_classes(["text-l4", "bold"]) main_val.set_halign(Gtk.Align.START) main_val.set_margin_end(10) info_box.append(main_val) diff --git a/src/frontendCardDayNight.py b/src/frontendCardDayNight.py index e84ba95..1a2e405 100644 --- a/src/frontendCardDayNight.py +++ b/src/frontendCardDayNight.py @@ -9,6 +9,7 @@ get_cords, get_time_difference, ) + gi.require_version("Gtk", "4.0") gi.require_version("Adw", "1") @@ -49,7 +50,7 @@ def get_sunset_sunrise_degree(self): sunrise = sunrise_dt.strftime("%H:%M") sunset = sunset_dt.strftime("%H:%M") - angle = self._calculate_sun_rotation(target_dt,sunrise_dt,sunset_dt) + angle = self._calculate_sun_rotation(target_dt, sunrise_dt, sunset_dt) return sunrise, sunset, angle def create_card(self): @@ -82,7 +83,7 @@ def create_card(self): card_info.attach(sun_rise_label, 0, 1, 1, 2) sun_rise = Gtk.Label(label=self.sun_rise) - sun_rise.set_margin_top(2) + sun_rise.set_margin_top(5) sun_rise.set_css_classes(["text-2a", "bold", "light-2"]) sun_rise.set_halign(Gtk.Align.START) card_info.attach(sun_rise, 0, 2, 3, 3) @@ -109,7 +110,7 @@ def create_card(self): card_icon.attach(obj.img_box, 0, 1, 1, 1) # Sun Rotation - def _calculate_sun_rotation(self,target_dt,sunrise_dt,sunset_dt): + def _calculate_sun_rotation(self, target_dt, sunrise_dt, sunset_dt): angle = 0 target_ctime_hr = target_dt.hour + (target_dt.minute / 60) target_sunrise_hr = sunrise_dt.hour + (sunrise_dt.minute / 60) @@ -117,13 +118,21 @@ def _calculate_sun_rotation(self,target_dt,sunrise_dt,sunset_dt): # day if target_ctime_hr > target_sunrise_hr and target_ctime_hr < target_sunset_hr: - angle = (target_ctime_hr-target_sunrise_hr)*180/(target_sunset_hr-target_sunrise_hr) - angle += 180 # Sun is above the horizon + angle = ( + (target_ctime_hr - target_sunrise_hr) + * 180 + / (target_sunset_hr - target_sunrise_hr) + ) + angle += 180 # Sun is above the horizon # Night else: if target_ctime_hr < target_sunrise_hr: target_ctime_hr += 24 # Adjust for times after midnight - angle = (target_ctime_hr - target_sunset_hr)*180/(24-(target_sunset_hr-target_sunrise_hr)) - - return angle \ No newline at end of file + angle = ( + (target_ctime_hr - target_sunset_hr) + * 180 + / (24 - (target_sunset_hr - target_sunrise_hr)) + ) + + return angle diff --git a/src/frontendCardSquare.py b/src/frontendCardSquare.py index 1230c06..feb49d3 100644 --- a/src/frontendCardSquare.py +++ b/src/frontendCardSquare.py @@ -2,8 +2,8 @@ import gi from .constants import icons from .config import settings -from .frontendUiDrawBar import * -from .frontendUiDrawImageIcon import * +from .frontendUiDrawBar import DrawLevelBar +from .frontendUiDrawImageIcon import DrawImage gi.require_version("Gtk", "4.0") gi.require_version("Adw", "1") @@ -72,7 +72,7 @@ def create_card(self): # convert pressure value to int self.main_val = int(self.main_val) if self.title == 'Pressure' else self.main_val main_val = Gtk.Label(label=self.main_val) - main_val.set_css_classes(["text-1", "bold"]) + main_val.set_css_classes(["text-2a", "bold"]) main_val.set_halign(Gtk.Align.START) card_info.attach(main_val, 0, 1, 3, 3)