Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser: accessibility: add label to combobox #9905

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions browser/css/jsdialogs.css
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@ input[type='number']:hover::-webkit-outer-spin-button {
}

.ui-listbox,
.ui-combobox,
.ui-timefield {
box-sizing: border-box;
-webkit-appearance: none;
Expand All @@ -815,6 +814,11 @@ input[type='number']:hover::-webkit-outer-spin-button {
color: var(--color-text-dark);
}

.ui-combobox label {
font-size: var(--default-font-size);
font-family: var(--jquery-ui-font);
}

.jsdialog-window .ui-listbox,
.jsdialog-window .ui-combobox,
.jsdialog-window .ui-timefield {
Expand Down Expand Up @@ -860,16 +864,14 @@ input[type='number']:hover::-webkit-outer-spin-button {
}

/* ui-combobox */
.ui-combobox,
.ui-timefield {
border: 1px solid var(--color-border);
}

.ui-combobox-content {
box-sizing: border-box;
border: 1px solid var(--color-border);
width: 100%;
height: 100%;
border: none;
border-start-start-radius: var(--border-radius);
border-end-start-radius: var(--border-radius);
color: var(--color-text-dark);
Expand All @@ -879,7 +881,10 @@ input[type='number']:hover::-webkit-outer-spin-button {

.ui-combobox-button {
padding-left: 20px;
border-left: 1px solid var(--color-border);
padding-top: 1px;
padding-bottom: 1px;
border: 1px solid var(--color-border);
background-color: var(--color-background-dark);
}

.ui-combobox-dropdown {
Expand Down
2 changes: 1 addition & 1 deletion browser/css/notebookbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ html[data-theme='dark'] .savemodified.unotoolbutton .unobutton img {

/* Home tab */
#fontsizecombobox.notebookbar {
width: 4.6rem;
width: 5.6rem;
}
.notebookbar.ui-combobox * {
line-height: 22px;
Expand Down
11 changes: 10 additions & 1 deletion browser/src/control/jsdialog/Widget.Combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* customEntryRenderer - specifies if entries have custom content which is rendered by the core
*/

/* global JSDialog $ */
/* global JSDialog $ _UNO */

JSDialog.comboboxEntry = function (parentContainer, data, builder) {
var entry = L.DomUtil.create('div', 'ui-combobox-entry ' + builder.options.cssClass, parentContainer);
Expand Down Expand Up @@ -183,6 +183,15 @@ JSDialog.combobox = function (parentContainer, data, builder) {
var container = L.DomUtil.create('div', 'ui-combobox ' + builder.options.cssClass, parentContainer);
container.id = data.id;

if (data.command) {
// TODO replace with data.label, changing ui file
var labelText = _UNO(data.command, 'label', true);
if (labelText) {
var label = L.DomUtil.create('label', '', container);
label.textContent = labelText + ':';
}
}

var content = L.DomUtil.create('input', 'ui-combobox-content ' + builder.options.cssClass, container);
content.value = data.text;
content.role = 'combobox';
Expand Down
3 changes: 3 additions & 0 deletions browser/src/unocommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ var unoCommandsArray = {
'ZTestDialog':{spreadsheet:{menu:_('~Z-test...'),},},
'ZoomMinus':{global:{menu:_('Zoom Out'),},},
'ZoomPlus':{global:{menu:_('Zoom In'),},},
'CharFontName':{label:{context:_('Font'),},},
'FontHeight':{label:{context:_('Size'),},},
'StyleApply':{label:{context:_('Style'),},},
};

window._UNO = function(string, component, isContext) {
Expand Down
Loading