add scaling for title margins

This commit is contained in:
flick0
2024-01-10 16:11:24 +00:00
parent 7f8752da9b
commit 5accf60e52
4 changed files with 12 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
import { Widget, Bluetooth, Variable } from "../imports.js";
import { NierButton } from "../nier/buttons.js";
import { NierDropDownButton } from "../nier/dropdown.js";
import { button_label_2 } from "../scaling.js";
import { button_label_2 , settings_title_bottom, settings_title_top } from "../scaling.js";
import { SCREEN_WIDTH } from "../util.js";
const { Label } = Widget;
@@ -12,7 +12,7 @@ export const BluetoothGroup = ({
passAssetsDir = assetsDir
}) => {
return [
Label({ hpack: "start", label: "BLUETOOTH", classNames: ["heading"] }),
Label({ hpack: "start", label: "BLUETOOTH", classNames: ["heading"], css:`margin-top: ${settings_title_top}px;margin-bottom: ${settings_title_bottom}px;` }),
NierDropDownButton({
useAssetsDir: passAssetsDir,
font_size: button_label_2,

View File

@@ -1,7 +1,7 @@
import { Widget,Audio,Variable } from "../imports.js";
import { NierButton } from "../nier/buttons.js";
import { NierSliderButton } from "../nier/slider.js";
import { button_label_2, button_slider_width } from "../scaling.js";
import { button_label_2, button_slider_width, settings_title_bottom, settings_title_top } from "../scaling.js";
import { assetsDir } from "../util.js";
const {Label} = Widget;
@@ -50,7 +50,7 @@ export const VolumeGroup = ({
passAssetsDir = assetsDir
}) => {
return [
Label({ hpack: "start", label: "VOLUME", classNames: ["heading"] }),
Label({ hpack: "start", label: "VOLUME", classNames: ["heading"] ,css:`margin-top: ${settings_title_top}px;margin-bottom: ${settings_title_bottom}px;`}),
volume_slider({useAssetsDir: passAssetsDir, type: "speaker", volume_ratio: volume_ratio }),
volume_slider({useAssetsDir: passAssetsDir, type: "microphone", volume_ratio: mic_volume_ratio }),
NierButton({
@@ -62,7 +62,7 @@ export const VolumeGroup = ({
handleClick: async (self, event) => {
await go_to(
[
Label({ hpack: "start", label: "APPS", classNames: ["heading"] }),
Label({ hpack: "start", label: "APPS", classNames: ["heading"] ,css:`margin-top: ${settings_title_top}px;margin-bottom: ${settings_title_bottom}px;` }),
...Array.from(Audio.apps).map((stream) => {
console.log(stream);
return volume_slider({
@@ -77,7 +77,7 @@ export const VolumeGroup = ({
);
},
}),
Label({ hpack: "start", label: "OUTPUT", classNames: ["heading"] }),
Label({ hpack: "start", label: "OUTPUT", classNames: ["heading"], css:`margin-top: ${settings_title_top}px;margin-bottom: ${settings_title_bottom}px;` }),
...Array.from(Audio.speakers).map((stream) => {
console.log(stream);
return volume_slider({
@@ -87,7 +87,7 @@ export const VolumeGroup = ({
});
}),
Label({ hpack: "start", label: "INPUT", classNames: ["heading"] }),
Label({ hpack: "start", label: "INPUT", classNames: ["heading"], css:`margin-top: ${settings_title_top}px;margin-bottom: ${settings_title_bottom}px;` }),
...Array.from(Audio.microphones).map((stream) => {
console.log(stream);
return volume_slider({

View File

@@ -1,6 +1,6 @@
import { Widget, Network, Variable } from "../imports.js";
import { NierDropDownButton } from "../nier/dropdown.js";
import { button_label_2 } from "../scaling.js";
import { button_label_2, settings_title_bottom, settings_title_top } from "../scaling.js";
import { SCREEN_WIDTH,assetsDir } from "../util.js";
const { Label } = Widget;
@@ -13,7 +13,7 @@ export const WifiGroup = ({
passAssetsDir = assetsDir
}) => {
return [
Label({ hpack: "start", label: "WIFI", classNames: ["heading"] }),
Label({ hpack: "start", label: "WIFI", classNames: ["heading"], css:`margin-top: ${settings_title_top}px;margin-bottom: ${settings_title_bottom}px;`}),
NierDropDownButton({
useAssetsDir: passAssetsDir,
font_size: button_label_2,

View File

@@ -401,7 +401,7 @@ const NierSettingPane = (
CLICK_TIMEOUT = false;
});
let [x, _] = await get_cursor();
print("cursor press", x, current_page);
if (x <= (SCREEN_WIDTH / 4) * (current_page + 1)) {
return;
}
@@ -409,8 +409,8 @@ const NierSettingPane = (
if (current_page == 0) {
App.toggleWindow("settings");
} else {
let next_page = panes_container.children[current_page].child;
let now_page = panes_container.children[current_page - 1].child;
let next_page = panes_container.pages[current_page].child;
let now_page = panes_container.pages[current_page - 1].child;
let now_buttons = now_page.children[1].children;
next_page.classNames = arradd(next_page.classNames, "closing");