settings: Use checkbox setting to toggle between 14/122 and 16/140.

The "Dense mode" checkbox is renamed to "Compact mode" and is used
to toggle between changing the font-size and line-height settings
between 14/122 and 16/140 configurations.
This commit is contained in:
Sahil Batra
2024-07-03 08:24:04 +05:30
committed by Tim Abbott
parent ad9837911e
commit b6905777d0
5 changed files with 40 additions and 5 deletions

View File

@@ -9,6 +9,12 @@ import * as blueslip from "./blueslip";
import * as compose_banner from "./compose_banner";
import type {DropdownWidget} from "./dropdown_widget";
import {$t} from "./i18n";
import {
LEGACY_FONT_SIZE_PX,
LEGACY_LINE_HEIGHT_PERCENT,
NON_COMPACT_MODE_FONT_SIZE_PX,
NON_COMPACT_MODE_LINE_HEIGHT_PERCENT,
} from "./information_density";
import {realm_user_settings_defaults} from "./realm_user_settings_defaults";
import * as scroll_util from "./scroll_util";
import * as settings_config from "./settings_config";
@@ -1080,6 +1086,15 @@ export function populate_data_for_default_realm_settings_request(
if (input_value !== undefined && input_value !== null) {
const property_name: string = extract_property_name($input_elem, true);
data[property_name] = input_value;
if (property_name === "dense_mode") {
data.web_font_size_px = input_value
? LEGACY_FONT_SIZE_PX
: NON_COMPACT_MODE_FONT_SIZE_PX;
data.web_line_height_percent = input_value
? LEGACY_LINE_HEIGHT_PERCENT
: NON_COMPACT_MODE_LINE_HEIGHT_PERCENT;
}
}
}
}