Skip to content

Commit ef54d20

Browse files
authored
Merge pull request #7807 from nextcloud-libraries/fix/NcHotkeyList--align-offset
fix(NcHotkeyList): align with form labels
2 parents dbabba7 + c96fa79 commit ef54d20

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,21 @@ export default {
688688
<NcAppSettingsSection id="about" name="About">
689689
<NcFormGroup label="Acknowledgements" description="This application includes CKEditor, an open-source editor. Copyright (C) CKEditor contributors. Licensed under GPLv2." />
690690
</NcAppSettingsSection>
691+
692+
<NcAppSettingsSectionShortcuts>
693+
<NcHotkeyList>
694+
<NcHotkey label="Compose new message" hotkey="C" />
695+
<NcHotkey label="Newer message" hotkey="ArrowLeft" />
696+
<NcHotkey label="Older message" hotkey="ArrowRight" />
697+
<NcHotkey label="Toggle star" hotkey="S" />
698+
<NcHotkey label="Toggle unread" hotkey="U" />
699+
<NcHotkey label="Archive" hotkey="A" />
700+
<NcHotkey label="Delete" hotkey="Delete" />
701+
<NcHotkey label="Search" hotkey="Control F" />
702+
<NcHotkey label="Send" hotkey="Control Enter" />
703+
<NcHotkey label="Refresh" hotkey="R" />
704+
</NcHotkeyList>
705+
</NcAppSettingsSectionShortcuts>
691706
</NcAppSettingsDialog>
692707
</div>
693708
</template>

src/components/NcHotkey/NcHotkey.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ const NO_LABEL_WARNING = '⚠️ NcHotKey must have a label or slot content'
5858

5959
<style lang="scss" module>
6060
.hotkey {
61+
--form-element-label-offset: calc(var(--border-radius-element) + var(--default-grid-baseline));
6162
display: flex;
6263
flex-direction: row-reverse;
6364
align-items: stretch;
64-
padding-inline: var(--border-radius-element); /* Align with form group */
65+
padding-inline: var(--form-element-label-offset);
6566
6667
&:first-child {
6768
.hotkey__label,

src/components/NcHotkeyList/NcHotkeyList.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ const labelId = `NcHotkeyList_${createElementId()}`
4141

4242
<style module>
4343
.hotkeyList {
44+
--form-element-label-offset: calc(var(--border-radius-element) + var(--default-grid-baseline));
4445
/* Too wide list is less readable - 400px seems a good width */
4546
max-width: 400px;
4647
}
4748
4849
.hotkeyList__heading {
4950
font-weight: bold;
50-
margin-inline: var(--border-radius-element); /* Align with form group */
51+
margin-inline: var(--form-element-label-offset);
5152
}
5253
</style>
5354

0 commit comments

Comments
 (0)