mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
styling changes of buttons
This commit is contained in:
parent
1f468f81cc
commit
c231b3cb79
1
package-lock.json
generated
1
package-lock.json
generated
@ -5,6 +5,7 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
|
"name": "trilium",
|
||||||
"version": "0.57.3",
|
"version": "0.57.3",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
@ -13,7 +13,7 @@ import utils from '../services/utils.js';
|
|||||||
*/
|
*/
|
||||||
export default class Component {
|
export default class Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.componentId = `comp-` + this.sanitizedClassName + '-' + utils.randomString(8);
|
this.componentId = this.sanitizedClassName + '-' + utils.randomString(8);
|
||||||
/** @type Component[] */
|
/** @type Component[] */
|
||||||
this.children = [];
|
this.children = [];
|
||||||
this.initialized = null;
|
this.initialized = null;
|
||||||
|
@ -143,13 +143,13 @@ export default class DesktopLayout {
|
|||||||
.ribbon(new NoteMapRibbonWidget())
|
.ribbon(new NoteMapRibbonWidget())
|
||||||
.ribbon(new SimilarNotesWidget())
|
.ribbon(new SimilarNotesWidget())
|
||||||
.ribbon(new NoteInfoWidget())
|
.ribbon(new NoteInfoWidget())
|
||||||
.button(new EditButton())
|
|
||||||
.button(new NoteRevisionsButton())
|
.button(new NoteRevisionsButton())
|
||||||
.button(new NoteActionsWidget())
|
.button(new NoteActionsWidget())
|
||||||
)
|
)
|
||||||
.child(new SharedInfoWidget())
|
.child(new SharedInfoWidget())
|
||||||
.child(new NoteUpdateStatusWidget())
|
.child(new NoteUpdateStatusWidget())
|
||||||
.child(new FloatingButtons()
|
.child(new FloatingButtons()
|
||||||
|
.child(new EditButton())
|
||||||
.child(new RelationMapButtons())
|
.child(new RelationMapButtons())
|
||||||
.child(new MermaidExportButton())
|
.child(new MermaidExportButton())
|
||||||
.child(new BacklinksWidget())
|
.child(new BacklinksWidget())
|
||||||
|
@ -72,6 +72,7 @@ class BasicWidget extends Component {
|
|||||||
render() {
|
render() {
|
||||||
this.doRender();
|
this.doRender();
|
||||||
|
|
||||||
|
this.$widget.attr('data-component-id', this.componentId);
|
||||||
this.$widget.addClass('component')
|
this.$widget.addClass('component')
|
||||||
.prop('component', this);
|
.prop('component', this);
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ export default class BookmarkButtons extends FlexContainer {
|
|||||||
? new BookmarkFolderWidget(note)
|
? new BookmarkFolderWidget(note)
|
||||||
: new OpenNoteButtonWidget().targetNote(note.noteId);
|
: new OpenNoteButtonWidget().targetNote(note.noteId);
|
||||||
|
|
||||||
|
buttonWidget.class("launcher-button");
|
||||||
|
|
||||||
this.child(buttonWidget);
|
this.child(buttonWidget);
|
||||||
|
|
||||||
this.$widget.append(buttonWidget.render());
|
this.$widget.append(buttonWidget.render());
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
||||||
|
|
||||||
const TPL = `<span class="button-widget icon-action bx"
|
const TPL = `<button class="button-widget no-print" data-toggle="tooltip">
|
||||||
data-toggle="tooltip"
|
<span class="bx"></span>
|
||||||
title=""></span>`;
|
</button>`;
|
||||||
|
|
||||||
export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
||||||
isEnabled() {
|
isEnabled() {
|
||||||
@ -22,6 +22,7 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
|
this.$iconSpan = this.$widget.find("span");
|
||||||
|
|
||||||
if (this.settings.onContextMenu) {
|
if (this.settings.onContextMenu) {
|
||||||
this.$widget.on("contextmenu", e => {
|
this.$widget.on("contextmenu", e => {
|
||||||
@ -49,9 +50,9 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshIcon() {
|
refreshIcon() {
|
||||||
for (const className of this.$widget[0].classList) {
|
for (const className of this.$iconSpan[0].classList) {
|
||||||
if (className.startsWith("bx-")) {
|
if (className.startsWith("bx-")) {
|
||||||
this.$widget.removeClass(className);
|
this.$iconSpan.removeClass(className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
|||||||
? this.settings.icon()
|
? this.settings.icon()
|
||||||
: this.settings.icon;
|
: this.settings.icon;
|
||||||
|
|
||||||
this.$widget.addClass(icon);
|
this.$iconSpan.addClass(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
initialRenderCompleteEvent() {
|
initialRenderCompleteEvent() {
|
||||||
@ -87,4 +88,4 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
|||||||
onContextMenu(handler) {
|
onContextMenu(handler) {
|
||||||
this.settings.onContextMenu = handler;
|
this.settings.onContextMenu = handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ export default class CreatePaneButton extends OnClickButtonWidget {
|
|||||||
this.icon("bx-dock-right")
|
this.icon("bx-dock-right")
|
||||||
.title("Create new split")
|
.title("Create new split")
|
||||||
.titlePlacement("bottom")
|
.titlePlacement("bottom")
|
||||||
.onClick(widget => widget.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() }));
|
.onClick(widget => widget.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() }))
|
||||||
|
.class("icon-action");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ export default class AbstractLauncher extends OnClickButtonWidget {
|
|||||||
constructor(launcherNote) {
|
constructor(launcherNote) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this.class("launcher-button");
|
||||||
|
|
||||||
/** @type {NoteShort} */
|
/** @type {NoteShort} */
|
||||||
this.launcherNote = launcherNote;
|
this.launcherNote = launcherNote;
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ export default class LeftPaneToggleWidget extends CommandButtonWidget {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this.class("launcher-button");
|
||||||
|
|
||||||
this.settings.icon = () => options.is('leftPaneVisible')
|
this.settings.icon = () => options.is('leftPaneVisible')
|
||||||
? "bx-chevrons-left"
|
? "bx-chevrons-left"
|
||||||
: "bx-chevrons-right";
|
: "bx-chevrons-right";
|
||||||
|
@ -7,7 +7,8 @@ export default class NoteRevisionsButton extends CommandButtonWidget {
|
|||||||
this.icon('bx-history')
|
this.icon('bx-history')
|
||||||
.title("Note Revisions")
|
.title("Note Revisions")
|
||||||
.command("showNoteRevisions")
|
.command("showNoteRevisions")
|
||||||
.titlePlacement("bottom");
|
.titlePlacement("bottom")
|
||||||
|
.class("icon-action");
|
||||||
}
|
}
|
||||||
|
|
||||||
isEnabled() {
|
isEnabled() {
|
||||||
|
@ -5,6 +5,8 @@ export default class ProtectedSessionStatusWidget extends CommandButtonWidget {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this.class("launcher-button");
|
||||||
|
|
||||||
this.settings.icon = () => protectedSessionHolder.isProtectedSessionAvailable()
|
this.settings.icon = () => protectedSessionHolder.isProtectedSessionAvailable()
|
||||||
? "bx-check-shield"
|
? "bx-check-shield"
|
||||||
: "bx-shield-quarter";
|
: "bx-shield-quarter";
|
||||||
|
@ -11,7 +11,7 @@ const TPL = `
|
|||||||
|
|
||||||
<button type="button" data-toggle="dropdown" data-placement="right"
|
<button type="button" data-toggle="dropdown" data-placement="right"
|
||||||
aria-haspopup="true" aria-expanded="false"
|
aria-haspopup="true" aria-expanded="false"
|
||||||
class="icon-action bx right-dropdown-button"></button>
|
class="bx right-dropdown-button launcher-button"></button>
|
||||||
|
|
||||||
<div class="dropdown-menu dropdown-menu-right"></div>
|
<div class="dropdown-menu dropdown-menu-right"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import OnClickButtonWidget from "../buttons/onclick_button.js";
|
|
||||||
import CalendarWidget from "../buttons/calendar.js";
|
import CalendarWidget from "../buttons/calendar.js";
|
||||||
import SpacerWidget from "../spacer.js";
|
import SpacerWidget from "../spacer.js";
|
||||||
import BookmarkButtons from "../bookmark_buttons.js";
|
import BookmarkButtons from "../bookmark_buttons.js";
|
||||||
@ -34,11 +33,14 @@ export default class LauncherWidget extends BasicWidget {
|
|||||||
const launcherType = note.getLabelValue("launcherType");
|
const launcherType = note.getLabelValue("launcherType");
|
||||||
|
|
||||||
if (launcherType === 'command') {
|
if (launcherType === 'command') {
|
||||||
this.innerWidget = this.initCommandWidget(note);
|
this.innerWidget = this.initCommandWidget(note)
|
||||||
|
.class("launcher-button");
|
||||||
} else if (launcherType === 'note') {
|
} else if (launcherType === 'note') {
|
||||||
this.innerWidget = new NoteLauncher(note);
|
this.innerWidget = new NoteLauncher(note)
|
||||||
|
.class("launcher-button");
|
||||||
} else if (launcherType === 'script') {
|
} else if (launcherType === 'script') {
|
||||||
this.innerWidget = new ScriptLauncher(note);
|
this.innerWidget = new ScriptLauncher(note)
|
||||||
|
.class("launcher-button");
|
||||||
} else if (launcherType === 'customWidget') {
|
} else if (launcherType === 'customWidget') {
|
||||||
this.innerWidget = await this.initCustomWidget(note);
|
this.innerWidget = await this.initCustomWidget(note);
|
||||||
} else if (launcherType === 'builtinWidget') {
|
} else if (launcherType === 'builtinWidget') {
|
||||||
|
@ -78,10 +78,6 @@ const TPL = `
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ribbon-button-container .icon-action {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ribbon-button-container > * {
|
.ribbon-button-container > * {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -3px;
|
top: -3px;
|
||||||
|
@ -20,9 +20,22 @@ const TPL = `
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.floating-buttons .floating-button {
|
.floating-buttons-children > button {
|
||||||
font-size: 130%;
|
font-size: 130%;
|
||||||
padding: 5px 10px 4px 10px;
|
padding: 5px 10px 4px 10px;
|
||||||
|
width: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--button-text-color);
|
||||||
|
background: var(--button-background-color);
|
||||||
|
border-radius: var(--button-border-radius);
|
||||||
|
border: 1px solid transparent;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-buttons-children > button:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
border-color: var(--button-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.floating-buttons.temporarily-hidden {
|
.floating-buttons.temporarily-hidden {
|
||||||
|
@ -2,8 +2,10 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
|||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="export-mermaid-button floating-button btn bx bx-export no-print"
|
class="export-mermaid-button no-print"
|
||||||
title="Export Mermaid diagram as SVG"></button>
|
title="Export Mermaid diagram as SVG">
|
||||||
|
<span class="bx bx-export"></span>
|
||||||
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default class MermaidExportButton extends NoteContextAwareWidget {
|
export default class MermaidExportButton extends NoteContextAwareWidget {
|
||||||
|
@ -109,7 +109,6 @@ button.close:hover {
|
|||||||
|
|
||||||
.icon-action {
|
.icon-action {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
padding: 5px;
|
|
||||||
width: 35px;
|
width: 35px;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -863,13 +862,14 @@ body {
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#launcher-pane .icon-action {
|
#launcher-pane .launcher-button {
|
||||||
font-size: 150%;
|
font-size: 150%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 15px 15px;
|
padding: 15px 15px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
color: var(--launcher-pane-text-color);
|
color: var(--launcher-pane-text-color);
|
||||||
|
background-color: var(--launcher-pane-background-color);
|
||||||
width: 53px;
|
width: 53px;
|
||||||
height: 53px;
|
height: 53px;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ const build = require('./build');
|
|||||||
const packageJson = require('../../package');
|
const packageJson = require('../../package');
|
||||||
const {TRILIUM_DATA_DIR} = require('./data_dir');
|
const {TRILIUM_DATA_DIR} = require('./data_dir');
|
||||||
|
|
||||||
const APP_DB_VERSION = 206;
|
const APP_DB_VERSION = 205;
|
||||||
const SYNC_VERSION = 28;
|
const SYNC_VERSION = 28;
|
||||||
const CLIPPER_PROTOCOL_VERSION = "1.0";
|
const CLIPPER_PROTOCOL_VERSION = "1.0";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user