Skip to content

Commit

Permalink
Add option to increase line height
Browse files Browse the repository at this point in the history
  • Loading branch information
Eggbertx committed Jan 20, 2025
1 parent 1463bba commit baa4a10
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2024, Gochan development group
Copyright (c) 2013-2025, Gochan development group
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
36 changes: 20 additions & 16 deletions frontend/sass/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@
@import "global/watcher";
@import 'global/bans';

.increase-line-height {
line-height: 1.5;
}

header {
margin-top:50px;
text-align:center;
margin-top: 50px;
text-align: center;
h1 {
margin: 0px;
}
}

div#topbar {
left:0;
position:fixed;
top:0;
width:100%;
margin-top:0px;
left: 0;
position: fixed;
top: 0;
width: 100%;
margin-top: 0px;

* {
padding: 4px;
Expand Down Expand Up @@ -63,15 +67,15 @@ div#staffmenu {
div.section-block {
margin-bottom: 8px;
div.section-title-block {
display:block;
padding:4px 8px 4px 8px;
display: block;
padding: 4px 8px 4px 8px;
}
div.section-body {
overflow-y: hidden;
margin-right: 0px;
margin-bottom:8px;
min-height: 48px;
padding:8px;
padding: 8px;
}
}

Expand All @@ -81,12 +85,12 @@ div.section-block {
}

#footer {
bottom:0px;
clear:both;
left:0px;
position:static;
text-align:center;
width:100%;
bottom: 0px;
clear: both;
left: 0px;
position: static;
text-align: center;
width: 100%;
}

select.post-actions {
Expand Down
13 changes: 12 additions & 1 deletion frontend/ts/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ interface MinMax {
min?: number;
max?: number;
}

class NumberSetting extends Setting<number, HTMLInputElement> {
constructor(key: string, title: string, defaultVal = 0, minMax: MinMax = {min: null, max: null}, onSave?:()=>any) {
super(key, title, defaultVal, onSave);
Expand Down Expand Up @@ -205,6 +206,15 @@ export function setTheme() {
else
themeElem.setAttribute("href", path.join(webroot ?? "/", "css", style));
}
setLineHeight();
}

function setLineHeight() {
if(getBooleanStorageVal("increaselineheight", false)) {
document.body.classList.add("increase-line-height");
} else {
document.body.classList.remove("increase-line-height");
}
}

/**
Expand Down Expand Up @@ -249,16 +259,17 @@ $(() => {
}
}) as Setting);
settings.set("pintopbar", new BooleanSetting("pintopbar", "Pin top bar", true, initTopBar));
settings.set("increaselineheight", new BooleanSetting("increaselineheight", "Increase line height", false, setLineHeight));
settings.set("enableposthover", new BooleanSetting("enableposthover", "Preview post on hover", true, initPostPreviews));
settings.set("enablepostclick", new BooleanSetting("enablepostclick", "Preview post on click", true, initPostPreviews));
settings.set("useqr", new BooleanSetting("useqr", "Use Quick Reply box", true, () => {
if(getBooleanStorageVal("useqr", true)) initQR();
else closeQR();
}));
settings.set("persistentqr", new BooleanSetting("persistentqr", "Persistent Quick Reply", false));
settings.set("watcherseconds", new NumberSetting("watcherseconds", "Check watched threads every # seconds", 15, {
min: 2
}, initWatcher));
settings.set("persistentqr", new BooleanSetting("persistentqr", "Persistent Quick Reply", false));
settings.set("newuploader", new BooleanSetting("newuploader", "Use new upload element", true, updateBrowseButton));

settings.set("customjs", new TextSetting("customjs", "Custom JavaScript", ""));
Expand Down
4 changes: 4 additions & 0 deletions html/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,10 @@ img#banpage-image {
margin: 4px 8px 8px 4px;
}

.increase-line-height {
line-height: 1.5;
}

header {
margin-top: 50px;
text-align: center;
Expand Down

0 comments on commit baa4a10

Please sign in to comment.