From 3d7df8e566abe024ad4e2685d945af9a6e0159c0 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 14 Sep 2022 12:41:09 +0200 Subject: [PATCH] WIP Universal Access preference: - Implements textsize preference --- api/js/etemplate/Styles/shoelace.ts | 4 ++-- calendar/templates/mobile/app.css | 4 ++-- pixelegg/css/pixelegg.css | 2 -- pixelegg/hook_settings.inc.php | 10 +++++----- pixelegg/inc/class.pixelegg_framework.inc.php | 18 ++++++++++++++++++ pixelegg/less/layout_raster_header.less | 1 - pixelegg/less/layout_raster_sidebar.less | 3 +-- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/api/js/etemplate/Styles/shoelace.ts b/api/js/etemplate/Styles/shoelace.ts index 36ed4113a2..2c326eeed8 100644 --- a/api/js/etemplate/Styles/shoelace.ts +++ b/api/js/etemplate/Styles/shoelace.ts @@ -39,11 +39,11 @@ export default [sl_css, css` :root, :host, .sl-theme-light { - --sl-font-size-medium: 12px; + --sl-font-size-medium: ${egw.preference('textsize', 'common') != '12' ? parseInt(egw.preference('textsize', 'common')) : 12}px; --sl-input-height-small: 24px; --sl-input-height-medium: 32px; - + --sl-button-font-size-medium: ${egw.preference('textsize', 'common') != '12' ? parseInt(egw.preference('textsize', 'common')) : 12}px; --sl-spacing-small: 0.1rem; --sl-spacing-medium: 0.5rem; diff --git a/calendar/templates/mobile/app.css b/calendar/templates/mobile/app.css index 0d4e6a55d4..8aecd45412 100644 --- a/calendar/templates/mobile/app.css +++ b/calendar/templates/mobile/app.css @@ -357,14 +357,14 @@ Hide subsequent headers in week view with non-consolidated owners #calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader > div[data-date] { display: none; } -#calendar-view_view.hideDayColHeader tr:first-of-type .calendar_calGridHeader > span.et2_label { +#calendar-view_view.hideDayColHeader tr:first-of-type .calendar_calGridHeader > et2-description { position: absolute; top: 2em; } #calendar-view_view.hideDayColHeader tr:first-of-type .calendar_calGridHeader .calendar_calDayColHeader_spacer { height: calc(1.5em + 32px); } -#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > span.et2_label { +#calendar-view_view.hideDayColHeader tr .calendar_calGridHeader > et2-description { white-space: nowrap; display: block; position: static; diff --git a/pixelegg/css/pixelegg.css b/pixelegg/css/pixelegg.css index 4ec2fc1616..daadcc42d3 100644 --- a/pixelegg/css/pixelegg.css +++ b/pixelegg/css/pixelegg.css @@ -4358,7 +4358,6 @@ span.overlayContainer img.overlay { #egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items ul li a { color: #000000; text-decoration: none; - font-size: 12px; padding-left: 26px; line-height: 1.9em; display: inline-block; @@ -5084,7 +5083,6 @@ span.overlayContainer img.overlay { position: relative; min-height: 18px; background-color: #FFFFFF; - overflow-x: hidden; white-space: nowrap; text-overflow: ellipsis; } diff --git a/pixelegg/hook_settings.inc.php b/pixelegg/hook_settings.inc.php index d00630f118..71a69bf6aa 100644 --- a/pixelegg/hook_settings.inc.php +++ b/pixelegg/hook_settings.inc.php @@ -40,10 +40,10 @@ $colors = array( ); $textsize = array ( - 's' => lang('small'), - 'm' => lang('medium'), - 'l' => lang('large'), - 'xl' => lang('x-large') + '10' => lang('small'), + '12' => lang('standard'), + '14' => lang('large'), + '16' => lang('x-large') ); asort($colors); @@ -146,7 +146,7 @@ $GLOBALS['settings'] = array( 'help' => lang('It sets content size (text only) according to selected size.'), 'xmlrpc' => True, 'values' => $textsize, - 'default' => 'm', + 'default' => '12', 'admin' => False, ), 'navbar_format' => false, // not used in JDots (defined in common prefs) diff --git a/pixelegg/inc/class.pixelegg_framework.inc.php b/pixelegg/inc/class.pixelegg_framework.inc.php index 7dba756528..00d18e277a 100755 --- a/pixelegg/inc/class.pixelegg_framework.inc.php +++ b/pixelegg/inc/class.pixelegg_framework.inc.php @@ -120,7 +120,25 @@ class pixelegg_framework extends Api\Framework\Ajax background-image: url($header); } "; + $textsize = $GLOBALS['egw_info']['user']['preferences']['common']['textsize']; + if (!empty($textsize) && $textsize != '12') + { + $ret['app_css'] .= " + /* + sharing + */ + body, + #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header h1, + #egw_fw_main #egw_fw_tabs .egw_fw_ui_tabs_header .egw_fw_ui_tab_header h1, + #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_content .egw_fw_ui_category_active h2, + table.egwGridView_grid, + .selectedTreeRow, + .standartTreeRow{ + font-size: {$textsize}px; + } + "; + } if (preg_match('/^(#[0-9A-F]+|[A-Z]+)$/i',$color) || preg_match('/^(#[0-9A-F]+|[A-Z]+)$/i',$loginbox_color)) // a little xss check { if (!Api\Header\UserAgent::mobile()) diff --git a/pixelegg/less/layout_raster_header.less b/pixelegg/less/layout_raster_header.less index b7d185e14b..339b0e34f7 100644 --- a/pixelegg/less/layout_raster_header.less +++ b/pixelegg/less/layout_raster_header.less @@ -171,7 +171,6 @@ a { color: @gray_100; text-decoration: none; - .fontsize_m; padding-left: 26px; line-height: 1.9em; display:inline-block; diff --git a/pixelegg/less/layout_raster_sidebar.less b/pixelegg/less/layout_raster_sidebar.less index c0f7c1112a..da0a33aea7 100644 --- a/pixelegg/less/layout_raster_sidebar.less +++ b/pixelegg/less/layout_raster_sidebar.less @@ -572,8 +572,7 @@ position: relative; min-height: 18px; background-color: @gray_0; - overflow-x: hidden; - white-space: nowrap; + white-space: nowrap; text-overflow: ellipsis; // Submenu Hover Item - gelb