Skip to content

Commit

Permalink
time_widget wip
Browse files Browse the repository at this point in the history
  • Loading branch information
realcopacetic committed Jul 16, 2024
1 parent 3aa21bc commit 1d1b1d4
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 57 deletions.
4 changes: 4 additions & 0 deletions 16x9/Colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@
<value condition="Control.HasFocus(14100) | Control.HasFocus(14101)">$VAR[Light_Color]</value>
<value>$VAR[Unfocused_Color]</value>
</variable>
<variable name="skinsettings_Time_Widget_Button_Textcolor">
<value condition="Control.HasFocus(11120) | Control.HasFocus(11121)">$VAR[Light_Color]</value>
<value>$VAR[Unfocused_Color]</value>
</variable>
<variable name="skinsettings_visualisation_Layout_Button_Textcolor">
<value condition="Control.HasFocus(14130) | Control.HasFocus(14131)">$VAR[Light_Color]</value>
<value>$VAR[Unfocused_Color]</value>
Expand Down
161 changes: 122 additions & 39 deletions 16x9/Components_Home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,93 @@
</definition>
</include>

<include name="Home_Time_Widget">
<include content="Time_Widget">
<param name="visible" value="![$EXP[Music_Player_IsVisible] | $EXP[Music_Player_HasFocus] | Window.IsVisible(volumebar) | Window.IsVisible(notification) | Window.IsVisible(extendedprogressdialog)] | Window.IsVisible(shutdownmenu)" />
<param name="include_date_and_weather" value="Skin.String(Time_Widget,Date) | Skin.String(Time_Widget,Weather)" />
<param name="include_weather" value="Skin.String(Time_Widget,Weather)" />
<param name="textcolor" value="$VAR[Notification_Widget_Label_Color]" />
</include>
</include>

<include name="Time_Widget">
<param name="visible" default="true" />
<param name="include_date_and_weather" default="true" />
<param name="include_weather" default="true" />
<param name="textcolor" default="$VAR[Light_Color]" />
<definition>
<control type="group">
<visible>$PARAM[visible]</visible>
<include content="VisibleHidden_Fade_Animation" />
<nested />
<include content="Date_And_Weather" condition="$PARAM[include_date_and_weather]">
<param name="include_weather" value="$PARAM[include_weather]" />
<param name="textcolor" value="$PARAM[textcolor]" />
</include>
<include content="Clock">
<param name="backgroundcolor" value="$PARAM[backgroundcolor]" />
<param name="textcolor" value="$PARAM[textcolor]" />
</include>
</control>
</definition>
</include>

<include name="Weather_Widget">
<definition>
<control type="image">
<visible>!String.IsEqual(Weather.Conditions,$LOCALIZE[503])</visible>
<width>33</width>
<height>33</height>
<texture>$INFO[Weather.ConditionsIcon]</texture>
</control>
<control type="label">
<visible>!String.IsEmpty(Weather.Temperature)</visible>
<font>MusicPlayer_Info</font>
<height>33</height>
<width>auto</width>
<label>$INFO[Weather.Temperature]</label>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
</control>
</definition>
</include>

<include name="Date_And_Weather">
<param name="visible" default="true" />
<param name="right" default="140" />
<param name="textcolor" default="$VAR[Light_Color]" />
<definition>
<control type="grouplist">
<right>$PARAM[right]</right>
<left>0</left>
<top>79</top>
<height>33</height>
<orientation>horizontal</orientation>
<align>right</align>
<itemgap>10</itemgap>
<control type="label">
<font>MusicPlayer_Info</font>
<height>100%</height>
<width>auto</width>
<label>$INFO[System.Date(ddd)]$INFO[System.Date(mmm d),$COMMA ]</label>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
</control>
<include content="Weather_Widget" condition="Weather.IsFetched + $PARAM[include_weather]">
<param name="textcolor" value="$PARAM[textcolor]" />
</include>
<control type="label">
<font>MusicPlayer_Info</font>
<height>100%</height>
<width>auto</width>
<label>$VAR[Copacetic_Divider_Bold]</label>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
</control>
</control>
</definition>
</include>

<include name="Clock">
<param name="visible" default="true" />
<param name="size" default="180" />
Expand All @@ -346,46 +433,42 @@
<param name="textcolor" default="$VAR[Light_Color]" />
<definition>
<control type="group">
<visible>![$EXP[Music_Player_IsVisible] | $EXP[Music_Player_HasFocus] | Window.IsVisible(volumebar) | Window.IsVisible(notification) | Window.IsVisible(extendedprogressdialog)] | Window.IsVisible(shutdownmenu)</visible>
<include content="VisibleHidden_Fade_Animation" />
<control type="group">
<visible>$PARAM[visible]</visible>
<right>$PARAM[right]</right>
<top>0</top>
<width>$PARAM[size]</width>
<height>$PARAM[size]</height>
<include content="Visible_Fade_Delayed_Animation" />
<control type="image">
<texture colordiffuse="$PARAM[backgroundcolor]">views/white_100.png</texture>
<visible>$PARAM[visible]</visible>
<right>$PARAM[right]</right>
<top>0</top>
<width>$PARAM[size]</width>
<height>$PARAM[size]</height>
<include content="Visible_Fade_Delayed_Animation" />
<control type="image">
<texture colordiffuse="$PARAM[backgroundcolor]">views/white_100.png</texture>
</control>
<control type="grouplist">
<left>15</left>
<right>15</right>
<centertop>50%</centertop>
<height>48</height>
<align>center</align>
<itemgap>3</itemgap>
<orientation>horizontal</orientation>
<usecontrolcoords>true</usecontrolcoords>
<control type="label">
<width>auto</width>
<height>100%</height>
<font>Title_Breadcrumb_Label</font>
<align>right</align>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
<label>$INFO[System.Time(hh)]</label>
</control>
<control type="grouplist">
<left>15</left>
<right>15</right>
<centertop>50%</centertop>
<height>70</height>
<align>center</align>
<itemgap>3</itemgap>
<orientation>horizontal</orientation>
<usecontrolcoords>true</usecontrolcoords>
<control type="label">
<width>auto</width>
<height>70</height>
<font>Main_Menu_Focused</font>
<align>right</align>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
<label>$INFO[System.Time(hh)]</label>
</control>
<control type="label">
<width>auto</width>
<height>55</height>
<top>13</top>
<font>Main_Menu_Unfocused</font>
<align>left</align>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
<label>$INFO[System.Time(mm)]</label>
</control>
<control type="label">
<width>auto</width>
<height>33</height>
<top>13</top>
<font>MusicPlayer_Info</font>
<align>left</align>
<aligny>center</aligny>
<textcolor>$PARAM[textcolor]</textcolor>
<label>$INFO[System.Time(mm)]</label>
</control>
</control>
</control>
Expand Down
28 changes: 18 additions & 10 deletions 16x9/Content_Settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,9 @@
</control>
<control type="button" id="1103">
<description>- Reset widgets</description>
<visible>ControlGroup(9).HasFocus(11) + Skin.HasSetting(Widgets_Enabled) + System.AddonIsEnabled(script.copacetic.helper)</visible>
<label>- $LOCALIZE[31430]</label>
<onclick>RunScript(script.copacetic.helper,action=dialog_yesno,heading=$LOCALIZE[31430],message=$LOCALIZE[31431],yes_actions=SetFocus(4200))</onclick>
<visible>ControlGroup(9).HasFocus(11) + Skin.HasSetting(Widgets_Enabled) + System.AddonIsEnabled(script.copacetic.helper)</visible>
</control>
<control type="label" id="1114">
<description>Global search</description>
Expand Down Expand Up @@ -499,26 +499,34 @@
</control>
<control type="radiobutton" id="1110">
<description>Enable screensaver</description>
<visible>ControlGroup(9).HasFocus(11)</visible>
<label>$LOCALIZE[31442]</label>
<onclick>Skin.ToggleSetting(Home_Screensaver_Enabled)</onclick>
<selected>Skin.HasSetting(Home_Screensaver_Enabled)</selected>
<visible>ControlGroup(9).HasFocus(11)</visible>
</control>
<control type="radiobutton" id="1111">
<description> - Show clearlogo</description>
<visible>ControlGroup(9).HasFocus(11) + Skin.HasSetting(Home_Screensaver_Enabled)</visible>
<label>- $LOCALIZE[31443]</label>
<onclick>Skin.ToggleSetting(Home_Screensaver_Clearlogo_Enabled)</onclick>
<selected>Skin.HasSetting(Home_Screensaver_Clearlogo_Enabled)</selected>
<visible>ControlGroup(9).HasFocus(11) + Skin.HasSetting(Home_Screensaver_Enabled)</visible>
</control>
<control type="radiobutton" id="1112">
<description>Hide clock</description>
<label>$LOCALIZE[31444]</label>
<onclick>Skin.ToggleSetting(Hide_Home_Clock)</onclick>
<selected>Skin.HasSetting(Hide_Home_Clock)</selected>
<visible>ControlGroup(9).HasFocus(11)</visible>
<include content="skinsettings_Slider_Button">
<param name="visible" value="ControlGroup(9).HasFocus(11)" />
<param name="info" value="Time_Widget" />
<param name="label" value="$LOCALIZE[31444]" />
<param name="label2" value="$VAR[skinsettings_Time_Widget_Label]" />
<param name="previous" value="1111" />
<param name="id" value="1112" />
<param name="next" value="1119" />
</include>
<control type="radiobutton" id="1119">
<description> - Make persistent across homescreen</description>
<visible>ControlGroup(9).HasFocus(11) + !Skin.String(Time_Widget,None)</visible>
<label>- $LOCALIZE[31728]</label>
<onclick>Skin.ToggleSetting(Time_Widget_Persistent)</onclick>
<selected>Skin.HasSetting(Time_Widget_Persistent)</selected>
</control>

<!-- Views -->
<control type="label" id="1350">
<description>General</description>
Expand Down
19 changes: 19 additions & 0 deletions 16x9/Content_Settings_Sliders.xml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,25 @@
<animation effect="slide" end="13" time="0" condition="Integer.IsGreater(Skin.String(Trailer_Autoplay_Interval),9)">Conditional</animation>
</include>

<include name="skinsettings_Time_Widget_Button_Conditions">
<onleft condition="Skin.String(Time_Widget,Weather)">Skin.SetString(Time_Widget,Date)</onleft>
<onleft condition="Skin.String(Time_Widget,Date)">Skin.SetString(Time_Widget,Clock)</onleft>
<onleft condition="Skin.String(Time_Widget,Clock) | !Skin.String(Time_Widget)">Skin.SetString(Time_Widget,None)</onleft>
<onright condition="Skin.String(Time_Widget,None)">Skin.SetString(Time_Widget,Clock)</onright>
<onright condition="Skin.String(Time_Widget,Clock) | !Skin.String(Time_Widget)">Skin.SetString(Time_Widget,Date)</onright>
<onright condition="Skin.String(Time_Widget,Date)">Skin.SetString(Time_Widget,Weather)</onright>
</include>
<include name="skinsettings_Time_Widget_Unfocused_Slides">
<animation effect="slide" end="40" time="0" condition="Skin.String(Time_Widget,Clock) | !Skin.String(Time_Widget)">Conditional</animation>
<animation effect="slide" end="80" time="0" condition="Skin.String(Time_Widget,Date)">Conditional</animation>
<animation effect="slide" end="120" time="0" condition="Skin.String(Time_Widget,Weather)">Conditional</animation>
</include>
<include name="skinsettings_Time_Widget_Focused_Slides">
<animation effect="slide" end="37" time="0" condition="Skin.String(Time_Widget,Clock) | !Skin.String(Time_Widget)">Conditional</animation>
<animation effect="slide" end="73" time="0" condition="Skin.String(Time_Widget,Date)">Conditional</animation>
<animation effect="slide" end="110" time="0" condition="Skin.String(Time_Widget,Weather)">Conditional</animation>
</include>

<include name="skinsettings_Infoscreen_Brightness_Button_Conditions">
<onleft condition="Skin.String(Infoscreen_Brightness,50)">Skin.SetString(Infoscreen_Brightness,33)</onleft>
<onleft condition="Skin.String(Infoscreen_Brightness,33)">Skin.SetString(Infoscreen_Brightness,25)</onleft>
Expand Down
4 changes: 1 addition & 3 deletions 16x9/DialogButtonMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
<param name="focused_color" value="$VAR[Light_Color]" />
<param name="unfocused_color" value="$VAR[Light_Color]" />
</include>
<include content="Clock">
<param name="textcolor" value="$VAR[Light_Color]" />
</include>
<include content="Time_Widget" condition="![Window.IsVisible(home) + Skin.HasSetting(Time_Widget_Persistent)] + !$EXP[Settings_Window_IsVisible]" />
<control type="list" id="3001">
<visible allowhiddenfocus="true">false</visible>
<onup>Close</onup>
Expand Down
5 changes: 2 additions & 3 deletions 16x9/Home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@
<param name="focused_color" value="$VAR[Light_Color]" />
<param name="unfocused_color" value="$VAR[Light_Color]" />
</include>
<include content="Home_Time_Widget" condition="!Skin.String(Time_Widget,None) + !Skin.HasSetting(Time_Widget_Persistent)" />
<include content="globalsearch_Button" condition="!Skin.HasSetting(GlobalSearch_Disabled)" />
<include content="Clock" condition="!Skin.HasSetting(Hide_Home_Clock)">
<param name="textcolor" value="$VAR[Notification_Widget_Label_Color]" />
</include>
</control>
<include content="Home_Widgets" condition="Skin.HasSetting(Widgets_Enabled)" />
<include content="Home_Time_Widget" condition="!Skin.String(Time_Widget,None) + Skin.HasSetting(Time_Widget_Persistent)" />
<include content="Music_Player_Widget" condition="Skin.HasSetting(Music_Player_Enabled)">
<param name="left_label_visible" value="true" />
<param name="background_visible" value="false" />
Expand Down
30 changes: 30 additions & 0 deletions 16x9/MyWeather.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<window>
<!-- weather -->
<backgroundcolor>$VAR[Dark_Color]</backgroundcolor>
<defaultcontrol always="true">2</defaultcontrol>
<controls>
<control type="grouplist">
<left>0</left>
<width>50%</width>
<control type="button" id="2" />
<control type="spincontrolex" id="3" />
</control>
<control type="grouplist">
<right>0</right>
<width>50%</width>
<control type="label" id="11" />
<control type="label" id="31" />
<control type="label" id="32" />
<control type="label" id="33" />
<control type="label" id="34" />
<control type="image" id="35" />
<control type="label" id="223" />
<control type="label" id="224" />
<control type="label" id="225" />
<control type="label" id="226" />
<control type="label" id="227" />
<control type="label" id="228" />
</control>
</controls>
</window>
1 change: 1 addition & 0 deletions 16x9/Startup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<onload condition="!Skin.String(Multiart_Interval)">Skin.SetString(Multiart_Interval,4)</onload>
<onload condition="!Skin.String(OSD_Background_Brightness)">Skin.SetString(OSD_Background_Brightness,25)</onload>
<onload condition="!Skin.String(Trailer_Autoplay_Interval)">Skin.SetString(Trailer_Autoplay_Interval,3)</onload>
<onload condition="!Skin.String(Time_Widget)">Skin.SetString(Time_Widget,Clock)</onload>
<onload condition="!Skin.String(script-upnext_Artwork)">Skin.SetString(script-upnext_Artwork,Fanart)</onload>
<onload condition="!Skin.String(visualisation_Layout)">Skin.SetString(visualisation_Layout,Small)</onload>
<onload condition="![Skin.HasSetting(Preferred_Rating_BBFC) | Skin.HasSetting(Preferred_Rating_MPAA) | Skin.HasSetting(Preferred_Rating_CHVRS) | Skin.HasSetting(Preferred_Rating_ACB) | Skin.HasSetting(Preferred_Rating_IFCO) | Skin.HasSetting(Preferred_Rating_FSK) | Skin.HasSetting(Preferred_Rating_DJCTQ) | Skin.HasSetting(Preferred_Rating_KIJKWIJZER) | Skin.HasSetting(Preferred_Rating_EIRIN)]">Skin.SetBool(Preferred_Rating_BBFC)</onload>
Expand Down
3 changes: 3 additions & 0 deletions 16x9/Templates_Panels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
</include>
<nested />
</control>
<include content="Time_Widget">
<include content="Settings_WindowOpenClose_Fade_Delayed_Long_Animation" />
</include>
</definition>
</include>

Expand Down
7 changes: 7 additions & 0 deletions 16x9/Variables_Labels_Windows.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
<value condition="Control.HasFocus(1110)">$LOCALIZE[31542]</value>
<value condition="Control.HasFocus(1111)">$LOCALIZE[31543]</value>
<value condition="Control.HasFocus(1118)">$LOCALIZE[31533]</value>
<value condition="Control.HasFocus(1112)">$LOCALIZE[31544]</value>
<!-- Views -->
<value condition="Control.HasFocus(1305) | Control.HasFocus(1355)">$LOCALIZE[31541]</value>
<value condition="Control.HasFocus(1315) | Control.HasFocus(1325) | Control.HasFocus(1338) | Control.HasFocus(1356)">$LOCALIZE[31598]</value>
Expand Down Expand Up @@ -298,6 +299,12 @@
<value condition="Skin.String(visualisation_Layout,Large)">$LOCALIZE[31483]</value>
<value>$LOCALIZE[31482]</value>
</variable>
<variable name="skinsettings_Time_Widget_Label">
<value condition="Skin.String(Time_Widget,Weather)">$LOCALIZE[31727]</value>
<value condition="Skin.String(Time_Widget,Date)">$LOCALIZE[31726]</value>
<value condition="Skin.String(Time_Widget,None)">$LOCALIZE[31725]</value>
<value>$LOCALIZE[31724]</value>
</variable>

<variable name="skinshortcuts_Background_Override_Label2">
<value condition="!String.IsEmpty(Container(211).ListItem.Property(backgroundPlaylist))">$INFO[Container(211).ListItem.Property(backgroundPlaylist)]</value>
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisc
- Added progress bar and remaining movies indicator for sets that aren't fully watched using a script.copacetic.helper script.
- Improved accuracy and efficiency of conditional animations for the progress bar unwatched episodes/movies indicator.
- Added ability to speed up animations and window transitions (Settings > Copacetic > General > Speed up animations and window transitions). This feature is currently in beta so further refinement may be necessary following wider testing. When enabled, there is a secondary option to 'Disable all viewtype scroll animations', which will further speed up the main media views by setting scrolltime to 0 https://github.com/realcopacetic/skin.copacetic/issues/73
- Fix for glitch in widget spotlight auto scroll function, which could cause widgets to momentarily disappear
- Fix for glitch in widget spotlight auto scroll function, which could cause widgets to momentarily disappear
- Fix for bug where secondary list was sometimes showing Poster art even when 'Prefer keyart' was selected for the specified view and vice versa https://github.com/realcopacetic/skin.copacetic/issues/174
- Added horizontal layouts for Gridview. In Settings > Copacetic > Views > Grid, you can now choose item layout. The options are 'Vertical small', 'Vertical large' and 'Horizontal' https://github.com/realcopacetic/skin.copacetic/issues/180
- Fixed bug where square widgets were showing fanart even when a thumbnail was available https://github.com/realcopacetic/skin.copacetic/issues/179
- Added new Time widget replacing the Clock. Now in Settings > Copacetic > Home > General, you can choose the furniture to include (None / Clock / Clock and Date / Clock, Date and Weather). Note: For weather to be displayed, you must install a weather addon and make sure it's enabled under Settings > Services > Weather https://github.com/realcopacetic/skin.copacetic/issues/177


Still to do:
---- Infoscreen transitions
Expand Down
Loading

0 comments on commit 1d1b1d4

Please sign in to comment.