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

Style-preview: Add scroll buttons #11039

Merged
Merged
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
4 changes: 0 additions & 4 deletions browser/css/jssidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ img.sidebar.ui-drawing-area {
padding: 0;
}

.ui-expander.jsdialog.sidebar .ui-expander-icon-right img {
filter: brightness(2);
}

.ui-expander.jsdialog.sidebar .ui-expander-icon-right:hover img {
filter: none;
}
Expand Down
30 changes: 30 additions & 0 deletions browser/css/notebookbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,36 @@ html[data-theme='dark'] .savemodified.unotoolbutton .unobutton img {
background-color: var(--color-stylesview-background);
filter: brightness(var(--brightness-stylesview));
box-sizing: border-box;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}

#stylesview-btn {
border: 1px solid var(--color-stylesview-border);
border-top-right-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
height: 64px;
margin-inline-start: -5px;
box-sizing: border-box;
}

#stylesview-btn.vertical {
gap: 0;
}

#stylesview-btn div{
border: none;
}

#stylesview-btn button img {
width: var(--btn-img-size-s) !important;
height: var(--btn-img-size-s) !important;
box-sizing: border-box;
}

#stylesview-btn button {
width: var(--btn-size-s) !important;
height: var(--btn-size-s) !important;
}

#stylesview:hover {
Expand Down
2 changes: 1 addition & 1 deletion browser/images/lc_morebutton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions browser/src/control/Control.NotebookbarWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,35 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'entries': [],
'vertical': 'false'
},
{
'id': 'stylesview-btn',
'type': 'container',
'children': [
{
'id': 'scroll-up',
'type': 'customtoolitem',
'text': _('Scroll up'),
'command': 'scrollpreviewup',
'icon': 'lc_searchprev.svg',
},
{
'id': 'scroll-down',
'type': 'customtoolitem',
'text': _('Scroll down'),
'command': 'scrollpreviewdown',
'icon': 'lc_searchnext.svg',
},
{
'id': 'format-style-list-dialog',
'type': 'toolitem',
'text': _('Style list'),
'command': '.uno:SidebarDeck.StyleListDeck',
'icon': 'lc_morebutton.svg',
'accessibility': { focusBack: true, combination: 'SD', de: null }
},
],
'vertical': 'true'
},
{ type: 'separator', id: 'home-stylesview-break', orientation: 'vertical' },
{
'type': 'container',
Expand Down
16 changes: 16 additions & 0 deletions browser/src/docdispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ class Dispatcher {
this.actionsMap['collapsenotebookbar'] = () => {
app.map.uiManager.collapseNotebookbar();
};

this.actionsMap['scrollpreviewup'] = () => {
const stylePreview = document.getElementById('stylesview');
stylePreview.scrollBy({
top: -stylePreview.offsetHeight,
behavior: 'smooth',
}); // Scroll up based on stylepreview height
};

this.actionsMap['scrollpreviewdown'] = () => {
const stylePreview = document.getElementById('stylesview');
stylePreview.scrollBy({
top: stylePreview.offsetHeight,
behavior: 'smooth',
}); // Scroll up based on stylepreview height
};
}

private addExportCommands() {
Expand Down