danielchalmers / DesktopClock

A digital clock for your desktop!
https://github.com/danielchalmers
MIT License
132 stars 33 forks source link

Large "OutlineThickness" is clipped #27

Closed breem42 closed 11 months ago

breem42 commented 1 year ago

First thanks for an excellent piece of software.

I'm using version 3.1.0.0 built from the unmodified source code today (Nov 1/2023).

I want a large digital clock with a large "blobby" white outline (yeah I know, I'm weird). Your program works really well for this, except it clips the outline at the top and left when "OutlineThickness" is set to more than about "1.0". I would like to use an outline of 3.0 or so.

I am using the "Crewniverse" font. Changing to the "Consolas" font fixes the problem, but the reason I chose your program (beside it being open source) is that it lets me set the font to what I want.

Here's an example:

image

I fiddled with the "DesktopClock.settings" with no effect. Maybe this is an basic limitation of the program right now?

Here's my "DesktopClock.settings":

{
  "Format": "t",
  "CountdownFormat": "",
  "CountdownTo": "0001-01-01T00:00:00+00:00",
  "TimeZone": "",
  "FontFamily": "Crewniverse",
  "TextColor": "#FF7458D3",
  "OuterColor": "#FFFFFFFF",
  "BackgroundEnabled": false,
  "BackgroundOpacity": 0.0,
  "OutlineThickness": 3.0,
  "CornerRadius": 3.0,
  "Topmost": false,
  "ShowInTaskbar": false,
  "Height": 160,
  "RunOnStartup": true,
  "DragToMove": true,
  "RightAligned": false,
  "Placement": {
    "Length": 44,
    "Flags": 0,
    "ShowCommand": 1,
    "MinimizedPosition": {
      "X": -1,
      "Y": -1
    },
    "MaximizedPosition": {
      "X": -1,
      "Y": -1
    },
    "NormalBounds": {
      "Left": 1228,
      "Top": 780,
      "Right": 1902,
      "Bottom": 940
    }
  }
}

Thanks for any assistance.

t

breem42 commented 12 months ago

So... I started tinkering. I know almost nothing about C#, but somehow I found my way to "MainWindow.xaml", and it's properties dialog. Poking around I found the margin properties. I set them all (top, bottom, left, right) to 10, and rebuilt the project. This fixed the clipping.

It's most certainly a kludge, and I'm sure that someone who knows what they are doing could code it more elegantly and have the margins be dynamic depending on the "OutlineThickness" value. But it works for now.

I compared the original "MainWindow.xaml" to the one I am using, and only line 118 was different.

Here is the original:

<Viewbox Height="{Binding Height, Source={x:Static p:Settings.Default}, Mode=OneWay}">

And here is the modified one:

<Viewbox Height="{Binding Height, Source={x:Static p:Settings.Default}, Mode=OneWay}" Margin="10,10,10,10">

There don't seem to be any other changes to the project.

It almost makes me want to learn C#.

danielchalmers commented 12 months ago

Great catch and I appreciate the investigation, thanks! This will be fixed in the next update.

breem42 commented 12 months ago

Great catch and I appreciate the investigation, thanks! This will be fixed in the next update.

It was fun to explore. I may tinker some more.

t

danielchalmers commented 11 months ago

Please let me know if you have any success with v4.0.0!