Skip to content

Commit

Permalink
v3.5.3 - [new] option to display the digital time within the analog c…
Browse files Browse the repository at this point in the history
…lock widget
  • Loading branch information
marius-sucan committed Jul 20, 2024
1 parent b40debe commit 0e21f35
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
5 changes: 5 additions & 0 deletions bells-tower-change-log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
; Work began on this project in late August 2018.
; ======================================================

v3.5.3 - 2024 / 07 / 20
- [new] option to display the digital time within the analog clock widget
- added «Our Lady of the Pillar» in the Catholic calendar
- minor fixes and improvements

v3.5.2 - 2024 / 06 / 25
- minor improvements

Expand Down
30 changes: 20 additions & 10 deletions bells-tower.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
;@Ahk2Exe-SetCopyright Marius Şucan (2017-2024)
;@Ahk2Exe-SetCompanyName https://marius.sucan.ro
;@Ahk2Exe-SetDescription Church Bells Tower
;@Ahk2Exe-SetVersion 3.5.2
;@Ahk2Exe-SetVersion 3.5.3
;@Ahk2Exe-SetOrigFilename bells-tower.ahk
;@Ahk2Exe-SetMainIcon bells-tower.ico

Expand Down Expand Up @@ -97,17 +97,14 @@ Global IniFile := "bells-tower.ini"
, showTimeWhenIdle := 0
, showTimeIdleAfter := 5 ; [in minutes]
, markFullMoonHowls := 0
, allowDSTchanges := 1
, allowDSTchanges := 1
, allowAltitudeSolarChanges := 1

; OSD settings
Global displayTimeFormat := 1
, DisplayTimeUser := 3 ; in seconds
, displayClock := 1
, showMoonPhaseOSD := 0
, analogDisplay := 0
, analogDisplayScale := 0.3
, analogMoonPhases := 1
, constantAnalogClock := 0
, showOSDprogressBar := 2
, GuiX := 40
Expand Down Expand Up @@ -165,11 +162,14 @@ Global displayTimeFormat := 1
, ClockCenter := Round(ClockWinSize/2)
, roundedCsize := Round(ClockDiameter/4)
, showAnalogHourLabels := 1
, analogDisplay := 0
, analogDisplayScale := 0.3
, analogMoonPhases := 1

; Release info
, ThisFile := A_ScriptName
, Version := "3.5.2"
, ReleaseDate := "2024 / 06 / 25"
, Version := "3.5.3"
, ReleaseDate := "2024 / 07 / 20"
, storeSettingsREG := FileExist("win-store-mode.ini") && A_IsCompiled && InStr(A_ScriptFullPath, "WindowsApps") ? 1 : 0
, ScriptInitialized, FirstRun := 1, uiUserCountry, uiUserCity, lastUsedGeoLocation, EquiSolsCache := 0
, QuotesAlreadySeen := "", LastWinOpened, hasHowledDay := 0, WinStorePath := A_ScriptDir
Expand Down Expand Up @@ -2402,7 +2402,12 @@ ToggleTickTock() {
}

toggleMoonPhasesAnalog() {
analogMoonPhases := !analogMoonPhases
analogMoonPhases := (analogMoonPhases=1) ? 0 : 1
INIaction(1, "analogMoonPhases", "SavedSettings")
}

toggleDigitalTimeAnalog() {
analogMoonPhases := (analogMoonPhases=2) ? 0 : 2
INIaction(1, "analogMoonPhases", "SavedSettings")
}

Expand Down Expand Up @@ -3779,6 +3784,8 @@ coreTestCelebrations(thisMon, thisMDay, thisYDay, isListMode, testWhat, thisYear
q := "The Protection of Our Most Holy Lady (Virgin Mary) - a celebration of the protection offered by Saint Mary to mankind"
Else If (testFeast="10.04" && UserReligion=1)
q := "Saint Francis of Assisi - an Italian friar, deacon, preacher and founder of the Friar Minors (OFM) within the Catholic church who lived between 1182 and 1226"
Else If (testFeast="10.12" && UserReligion=1)
q := "Our Lady of the Pillar - Virgin Mary appeared to the Apostle James the Greater in AD 40, in Spain, while being alive in Jerusalem. It is considered the first Marian apparition and the only recorded instance of Mary exhibiting the mystical phenomenon of bilocation"
Else If (testFeast="10.14" && UserReligion=2)
q := "Saint Paraskeva of the Balkans - an ascetic female saint of the 10th century of half Serbian and half Greek origins"
Else If (testFeast="10.31" && UserReligion=1)
Expand Down Expand Up @@ -4141,6 +4148,7 @@ updateHolidaysLVs() {
, ExaltationHolyCross := "09.14"
, ProtectSaintMary := "10.01"
, SaintFrancisAssisi := "10.04"
, LadyPilar := "10.12"
, SaintParaskeva := "10.14"
, HalloweenDay := "10.31"
, Allsaintsday := "11.01"
Expand Down Expand Up @@ -4209,6 +4217,7 @@ updateHolidaysLVs() {
. "Birth of the Blessed Virgin Mary|" BirthVirginMary "`n"
. "Exaltation of the Holy Cross|" ExaltationHolyCross "`n"
. "Saint Francis of Assisi|" SaintFrancisAssisi "`n"
. "Our Lady of the Pillar|" LadyPilar "`n"
. "All Hallows' Eve [Hallowe'en]|" HalloweenDay "`n"
. "All Saints' day|" Allsaintsday "`n"
. "All souls' day|" Allsoulsday "`n"
Expand Down Expand Up @@ -10969,7 +10978,6 @@ CheckSettings() {
BinaryVar(userMustDoTimer, 0)
BinaryVar(orderedBibleQuotes, 0)
BinaryVar(AlarmersDarkScreen, 1)
BinaryVar(analogMoonPhases, 1)
BinaryVar(showAnalogHourLabels, 1)

; verify numeric values: min, max and default values
Expand Down Expand Up @@ -11014,6 +11022,7 @@ CheckSettings() {
MinMaxVar(userAlarmFreq, 1, 99, 4)
MinMaxVar(showOSDprogressBar, 1, 6, 2)
MinMaxVar(OSDastralMode, 1, 4, 1)
MinMaxVar(analogMoonPhases, 0, 2, 0)

If (silentHoursB<silentHoursA)
silentHoursB := silentHoursA
Expand Down Expand Up @@ -13199,7 +13208,8 @@ FolderExist(filePath) {
Return

Space::
toggleMoonPhasesAnalog()
analogMoonPhases := clampInRange(analogMoonPhases + 1, 0, 2, 1)
INIaction(1, "analogMoonPhases", "SavedSettings")
Return

Tab::
Expand Down
24 changes: 23 additions & 1 deletion lib/analog-clock-display.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,26 @@ UpdateEverySecond() {
Gdip_SetSmoothingMode(globalG, 4) ; turn on antialiasing
; draw moon phase
If (analogMoonPhases=1)
{
coreMoonPhaseDraw(clockBgrColor, clockFgrColor, CenterX, CenterY, ClockDiameter, lastUsedGeoLocation, globalG)
} Else If (analogMoonPhases=2)
{
pBrush := Gdip_BrushCreateSolid("0xDD" clockFgrColor)
Gdip_FillRoundedRectangle(globalG, pBrush, CenterX - (ClockDiameter*0.175), CenterY*1.145, ClockDiameter/2.58, ClockDiameter*0.12, 4*analogDisplayScale)
Gdip_DeleteBrush(pBrush)
ppo := " x" CenterX - (ClockDiameter*0.185) " y" CenterY*1.155
txtOptions := ppo " Center vCenter cFF" clockBgrColor " Bold nowrap s" Round(CenterY*0.11)
If (displayTimeFormat=1)
{
FormatTime, CurrentTime,, HH:mm:ss
} Else
{
timeSuffix := (A_Hour<12) ? " AM" : " PM"
FormatTime, CurrentTime,, h:mm
}

Gdip_TextToGraphics(globalG, CurrentTime timeSuffix, txtOptions, "Arial", ClockDiameter/2.49, ClockDiameter*0.12)
}

; Draw HoursPointer
t := (A_Hour*360//12) + ((A_Min//15*15)*360//60)//12 + 90
Expand Down Expand Up @@ -460,12 +479,15 @@ showContextMenuAnalogClock() {
Menu, ContextMenu, Add, Rounded &widget, toggleRoundedWidget
If (roundedClock=1)
Menu, ContextMenu, Check, Rounded &widget
Menu, ContextMenu, Add, Show &moon phases, toggleMoonPhasesAnalog
Menu, ContextMenu, Add, Show &hour labels, toggleHourLabelsAnalog
Menu, ContextMenu, Add, Show digital cloc&k, toggleDigitalTimeAnalog
Menu, ContextMenu, Add, Show &moon phases, toggleMoonPhasesAnalog
Try Menu, ContextMenu, Add, % pk[1], dummy
Try Menu, ContextMenu, Disable, % pk[1]
If (analogMoonPhases=1)
Menu, ContextMenu, Check, Show &moon phases
If (analogMoonPhases=2)
Menu, ContextMenu, Check, Show digital cloc&k
If (showAnalogHourLabels=1)
Menu, ContextMenu, Check, Show &hour labels

Expand Down

0 comments on commit 0e21f35

Please sign in to comment.