Skip to content

Commit 777cd26

Browse files
authored
Merge pull request #11 from SillyLittleTech/copilot/add-system-theme-support
Add system theme support, pin emoji icon, and compact toolbar
2 parents 3983044 + 1d080f3 commit 777cd26

8 files changed

Lines changed: 70 additions & 17 deletions

File tree

PinStickApp.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ struct ContentView: View {
8282
Button(action: togglePin) {
8383
Image(systemName: isPinned ? "pin.slash" : "pin")
8484
.help(isPinned ? "Unpin Window" : "Pin Window")
85+
.font(.system(size: 12))
8586
}
8687
.buttonStyle(PlainButtonStyle())
87-
.padding(6)
88+
.padding(.horizontal, 8)
89+
.padding(.vertical, 4)
8890

8991
Spacer()
9092
}
@@ -95,7 +97,6 @@ struct ContentView: View {
9597
TextEditor(text: $text)
9698
.padding(8)
9799
.font(.system(size: 16, design: .monospaced))
98-
.background(Color.white)
99100
}
100101
.frame(maxWidth: .infinity, maxHeight: .infinity)
101102
.onChange(of: text) { oldValue, newValue in

cross-platform/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pinstick-cross",
3-
"version": "2.5.8",
3+
"version": "2.6.0",
44
"private": true,
55
"type": "module",
66
"scripts": {

cross-platform/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cross-platform/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pinstick"
3-
version = "2.5.8"
3+
version = "2.6.0"
44
description = "PinStick cross-platform note pinning app"
55
authors = ["SillyLittleTech"]
66
edition = "2021"

cross-platform/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "PinStick",
11-
"version": "2.5.8"
11+
"version": "2.6.0"
1212
},
1313
"tauri": {
1414
"security": {

cross-platform/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010
<header>
1111
<div class="left">
12-
<button id="pin-btn" type="button" title="Pin window">Pin</button>
12+
<button id="pin-btn" type="button" title="Pin window" aria-label="Pin window">📌</button>
1313
</div>
1414
<div class="right">
1515
<span id="status">Ready</span>

cross-platform/src/main.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ async function togglePin() {
4141
result && Object.prototype.hasOwnProperty.call(result, "pinned")
4242
? result.pinned
4343
: false;
44-
pinBtn.textContent = pinned ? "Unpin" : "Pin";
44+
pinBtn.classList.toggle("pinned", pinned);
45+
pinBtn.title = pinned ? "Unpin window" : "Pin window";
46+
pinBtn.setAttribute("aria-label", pinned ? "Unpin window" : "Pin window");
4547
setStatus(pinned ? "Pinned on top" : "Not pinned");
4648
} catch (err) {
4749
console.error(err);
@@ -56,6 +58,13 @@ function init() {
5658
if (!invoke) {
5759
pinBtn.disabled = true;
5860
setStatus("Tauri API unavailable");
61+
} else if (TAURI && TAURI.app) {
62+
// Briefly show the app version so users can verify which build is running
63+
TAURI.app.getVersion().then((version) => {
64+
const previous = statusEl.textContent;
65+
setStatus(`v${version}`);
66+
setTimeout(() => setStatus(previous), 2000);
67+
}).catch(() => { /* non-critical */ });
5968
}
6069

6170
noteEl.addEventListener("input", (e) => {

cross-platform/src/styles.css

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,39 @@ header {
1616
display: flex;
1717
align-items: center;
1818
justify-content: space-between;
19-
padding: 10px;
19+
padding: 3px 8px;
2020
background: #ffffff;
2121
border-bottom: 1px solid #e0e0e0;
2222
}
2323

2424
header button {
25-
padding: 6px 12px;
25+
padding: 2px 6px;
2626
font-size: 14px;
27-
border: 1px solid #ccc;
28-
background: #fff;
29-
border-radius: 6px;
27+
border: 1px solid transparent;
28+
background: transparent;
29+
border-radius: 5px;
3030
cursor: pointer;
31+
line-height: 1.4;
32+
transition: background 0.15s;
33+
}
34+
35+
header button:hover {
36+
background: rgba(0, 0, 0, 0.07);
37+
}
38+
39+
header button.pinned {
40+
background: rgba(0, 0, 0, 0.1);
41+
border-color: rgba(0, 0, 0, 0.15);
3142
}
3243

3344
header button:disabled {
34-
opacity: 0.6;
45+
opacity: 0.4;
3546
cursor: not-allowed;
3647
}
3748

3849
main {
3950
flex: 1;
40-
padding: 10px;
51+
padding: 8px;
4152
}
4253

4354
textarea {
@@ -50,9 +61,41 @@ textarea {
5061
border: 1px solid #d0d0d0;
5162
border-radius: 8px;
5263
background: #ffffff;
64+
color: #222;
5365
}
5466

5567
#status {
56-
font-size: 12px;
57-
color: #555;
68+
font-size: 11px;
69+
color: #666;
70+
}
71+
72+
@media (prefers-color-scheme: dark) {
73+
body {
74+
background: #1e1e1e;
75+
color: #e0e0e0;
76+
}
77+
78+
header {
79+
background: #2a2a2a;
80+
border-bottom-color: #3a3a3a;
81+
}
82+
83+
header button:hover {
84+
background: rgba(255, 255, 255, 0.1);
85+
}
86+
87+
header button.pinned {
88+
background: rgba(255, 255, 255, 0.15);
89+
border-color: rgba(255, 255, 255, 0.2);
90+
}
91+
92+
textarea {
93+
background: #2a2a2a;
94+
color: #e0e0e0;
95+
border-color: #3a3a3a;
96+
}
97+
98+
#status {
99+
color: #888;
100+
}
58101
}

0 commit comments

Comments
 (0)