right-align the buttons

This commit is contained in:
Ell 2024-02-26 14:53:33 +01:00
parent 5bd9fefe60
commit 7e108a85cb
2 changed files with 7 additions and 2 deletions

View file

@ -42,7 +42,7 @@ export function loadTracker(json: string): Tracker {
} }
export function displayTracker(tracker: Tracker, element: HTMLElement, file: string, getSectionInfo: () => MarkdownSectionInformation, settings: SimpleTimeTrackerSettings): void { export function displayTracker(tracker: Tracker, element: HTMLElement, file: string, getSectionInfo: () => MarkdownSectionInformation, settings: SimpleTimeTrackerSettings): void {
element.classList.add("simple-time-tracker-container"); element.addClass("simple-time-tracker-container");
// add start/stop controls // add start/stop controls
let running = isRunning(tracker); let running = isRunning(tracker);
let btn = new ButtonComponent(element) let btn = new ButtonComponent(element)
@ -305,7 +305,7 @@ class EditableField {
this.label = this.cell.createEl("span", {text: value}); this.label = this.cell.createEl("span", {text: value});
this.label.style.marginLeft = `${indent}em`; this.label.style.marginLeft = `${indent}em`;
this.box = new TextComponent(this.cell).setValue(value); this.box = new TextComponent(this.cell).setValue(value);
this.box.inputEl.classList.add("simple-time-tracker-input"); this.box.inputEl.addClass("simple-time-tracker-input");
this.box.inputEl.hide(); this.box.inputEl.hide();
} }
@ -373,6 +373,7 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle
row.createEl("td", {text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry), settings) : ""}); row.createEl("td", {text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry), settings) : ""});
let entryButtons = row.createEl("td"); let entryButtons = row.createEl("td");
entryButtons.addClass("simple-time-tracker-table-buttons");
new ButtonComponent(entryButtons) new ButtonComponent(entryButtons)
.setClass("clickable-icon") .setClass("clickable-icon")
.setIcon(`lucide-play`) .setIcon(`lucide-play`)

View file

@ -71,3 +71,7 @@
max-width: 150px; max-width: 150px;
min-width: 100px; min-width: 100px;
} }
.simple-time-tracker-table-buttons {
text-align: right !important;
}