Skip to content

Commit 7434274

Browse files
KAMI911claude
andcommitted
feat(calendarium@kami911): add optional customizable border
New Appearance settings: "Draw a border around the desklet" with adjustable width (1–10 px), color (colorchooser) and corner radius (0–40 px). Off by default; when enabled the border and radius are applied to the container style alongside the existing background/opacity styling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
1 parent c9c943c commit 7434274

4 files changed

Lines changed: 90 additions & 1 deletion

File tree

calendarium@kami911/files/calendarium@kami911/desklet.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ CalendariumDesklet.prototype = {
238238
s.bind("icon-size", "icon_size", cb);
239239
s.bind("text-scale", "text_scale", cb);
240240
s.bind("bg-opacity", "bg_opacity", cb);
241+
s.bind("show-border", "show_border", cb);
242+
s.bind("border-width", "border_width", cb);
243+
s.bind("border-color", "border_color", cb);
244+
s.bind("border-radius", "border_radius", cb);
241245
},
242246

243247
/**
@@ -930,6 +934,15 @@ CalendariumDesklet.prototype = {
930934
"font-size: " + basePx + "px;" +
931935
"background-color: rgba(0, 0, 0, " + op.toFixed(2) + ");";
932936

937+
if (this.show_border) {
938+
let bw = Math.max(1, Math.min(10, Math.round(this.border_width || 1)));
939+
let bc = this.border_color || "rgba(255,255,255,0.35)";
940+
let br = Math.max(0, Math.min(40, Math.round(this.border_radius || 0)));
941+
containerStyle +=
942+
"border: " + bw + "px solid " + bc + ";" +
943+
"border-radius: " + br + "px;";
944+
}
945+
933946
// Icon / symbol size for moon and zodiac symbols
934947
let px = this._getIconPx();
935948
this._labelMoonIcon.set_style(

calendarium@kami911/files/calendarium@kami911/po/calendarium@kami911.pot

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,26 @@ msgid ""
932932
"0 = fully transparent (wallpaper shows through), 1 = solid black background"
933933
msgstr ""
934934

935+
#. settings-schema.json->show-border->description
936+
msgid "Draw a border around the desklet"
937+
msgstr ""
938+
939+
#. settings-schema.json->border-width->description
940+
msgid "Border width"
941+
msgstr ""
942+
943+
#. settings-schema.json->border-color->description
944+
msgid "Border color"
945+
msgstr ""
946+
947+
#. settings-schema.json->border-radius->description
948+
msgid "Corner radius"
949+
msgstr ""
950+
951+
#. settings-schema.json->border-radius->tooltip
952+
msgid "0 = square corners"
953+
msgstr ""
954+
935955
#. settings-schema.json->show-julian->description
936956
msgid "Show Julian calendar date"
937957
msgstr ""

calendarium@kami911/files/calendarium@kami911/po/hu.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,26 @@ msgid ""
966966
"0 = fully transparent (wallpaper shows through), 1 = solid black background"
967967
msgstr "0 = teljesen átlátszó (áttűnik a háttérkép), 1 = tömör fekete háttér"
968968

969+
#. settings-schema.json->show-border->description
970+
msgid "Draw a border around the desklet"
971+
msgstr "Keret rajzolása a desklet köré"
972+
973+
#. settings-schema.json->border-width->description
974+
msgid "Border width"
975+
msgstr "Keret vastagsága"
976+
977+
#. settings-schema.json->border-color->description
978+
msgid "Border color"
979+
msgstr "Keret színe"
980+
981+
#. settings-schema.json->border-radius->description
982+
msgid "Corner radius"
983+
msgstr "Sarkok lekerekítése"
984+
985+
#. settings-schema.json->border-radius->tooltip
986+
msgid "0 = square corners"
987+
msgstr "0 = szögletes sarkok"
988+
969989
#. settings-schema.json->show-julian->description
970990
msgid "Show Julian calendar date"
971991
msgstr "Julián naptár dátumának megjelenítése"

calendarium@kami911/files/calendarium@kami911/settings-schema.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@
134134
"section-appearance": {
135135
"type": "section",
136136
"title": "Appearance",
137-
"keys": ["icon-size", "text-scale", "bg-opacity"]
137+
"keys": ["icon-size", "text-scale", "bg-opacity",
138+
"show-border", "border-width", "border-color", "border-radius"]
138139
}
139140
},
140141

@@ -675,6 +676,41 @@
675676
"description": "Background opacity",
676677
"tooltip": "0 = fully transparent (wallpaper shows through), 1 = solid black background"
677678
},
679+
"show-border": {
680+
"type": "checkbox",
681+
"default": false,
682+
"description": "Draw a border around the desklet"
683+
},
684+
"border-width": {
685+
"type": "spinbutton",
686+
"default": 1,
687+
"min": 1,
688+
"max": 10,
689+
"step": 1,
690+
"units": "pixels",
691+
"description": "Border width",
692+
"dependency": "show-border",
693+
"indent": true
694+
},
695+
"border-color": {
696+
"type": "colorchooser",
697+
"default": "rgba(255,255,255,0.35)",
698+
"description": "Border color",
699+
"dependency": "show-border",
700+
"indent": true
701+
},
702+
"border-radius": {
703+
"type": "spinbutton",
704+
"default": 0,
705+
"min": 0,
706+
"max": 40,
707+
"step": 1,
708+
"units": "pixels",
709+
"description": "Corner radius",
710+
"tooltip": "0 = square corners",
711+
"dependency": "show-border",
712+
"indent": true
713+
},
678714

679715
"show-julian": {
680716
"type": "checkbox",

0 commit comments

Comments
 (0)