Skip to content

Commit fce8827

Browse files
committed
careful enhance with header size
1 parent 39c71d3 commit fce8827

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

data/Application.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ editablelabel {
3131
padding-right: 24px;
3232
text-shadow: 0px 1px rgba(255,255,255,0.5);
3333
/* text-shadow: none; */
34-
letter-spacing: .03em;
34+
letter-spacing: .04em;
3535
}
3636

3737
textview,
@@ -41,7 +41,7 @@ editablelabel.editing {
4141
box-shadow: none;
4242
text-shadow: none;
4343
line-height: 1.35em;
44-
letter-spacing: .01em;
44+
letter-spacing: .02em;
4545
}
4646

4747

src/MainWindow.vala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ namespace jorts {
106106
this.data = data;
107107
this.title_name = data.title;
108108
this.theme = data.theme;
109+
this.zoom = data.zoom;
109110
this.content = data.content;
110111

111112
this.set_title (this.title_name);
@@ -138,7 +139,7 @@ namespace jorts {
138139

139140
//headerbar.decoration_layout = "close:";
140141
headerbar.set_show_title_buttons(false);
141-
headerbar.height_request = 36;
142+
headerbar.height_request = jorts.Utils.zoom_to_UIsize(this.zoom);
142143

143144
// Defime the label you can edit. Which is editable.
144145
notetitle = new Gtk.EditableLabel (this.title_name);
@@ -474,14 +475,18 @@ namespace jorts {
474475

475476
// Switch zoom classes, then reflect in the UI and tell the application
476477
public void set_zoom(int zoom) {
478+
479+
477480
// Switches the classes that control font size
478481
this.remove_css_class (jorts.Utils.zoom_to_class( this.zoom));
479482
this.zoom = zoom;
480483
this.add_css_class (jorts.Utils.zoom_to_class( this.zoom));
481484

485+
this.headerbar.height_request = jorts.Utils.zoom_to_UIsize(this.zoom);
486+
482487
// Reflect the number in the popover
483488
this.popover.set_zoomlevel(zoom);
484-
489+
485490
// Keep it for next new notes
486491
((Application)this.application).latest_zoom = zoom;
487492
}

src/Services/Utils.vala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ namespace jorts.Utils {
5353
}
5454
}
5555

56+
/*************************************************/
57+
// We cannot use numbers in CSS, so we have to translate a number into a string
58+
public int zoom_to_UIsize(int zoom) {
59+
switch (zoom) {
60+
case 20: return 24;
61+
case 40: return 26;
62+
case 60: return 28;
63+
case 80: return 30;
64+
case 100: return 32;
65+
case 120: return 34;
66+
case 140: return 38;
67+
case 160: return 40;
68+
case 180: return 44;
69+
case 200: return 48;
70+
case 220: return 52;
71+
case 240: return 54;
72+
case 260: return 56;
73+
case 280: return 60;
74+
case 300: return 64;
75+
default: return 32;
76+
}
77+
}
5678

5779
/*************************************************/
5880
// Spits out a random theme for a new note

src/Widgets/StickyView.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class jorts.StickyView : Granite.HyperTextView {
6363
this.bottom_margin = 12;
6464
this.left_margin = 12;
6565
this.right_margin = 12;
66-
this.top_margin = 12;
66+
this.top_margin = 6;
6767

6868
this.set_hexpand (true);
6969
this.set_vexpand (true);

0 commit comments

Comments
 (0)