Skip to content

Commit 508b0a8

Browse files
authored
Merge pull request #7810 from nextcloud-libraries/backport/7807/stable8
[stable8] fix(NcHotkeyList): align with form labels
2 parents e35d454 + eadb110 commit 508b0a8

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
@@ -690,6 +690,21 @@ export default {
690690
<NcAppSettingsSection id="about" name="About">
691691
<NcFormGroup label="Acknowledgements" description="This application includes CKEditor, an open-source editor. Copyright (C) CKEditor contributors. Licensed under GPLv2." />
692692
</NcAppSettingsSection>
693+
694+
<NcAppSettingsSectionShortcuts>
695+
<NcHotkeyList>
696+
<NcHotkey label="Compose new message" hotkey="C" />
697+
<NcHotkey label="Newer message" hotkey="ArrowLeft" />
698+
<NcHotkey label="Older message" hotkey="ArrowRight" />
699+
<NcHotkey label="Toggle star" hotkey="S" />
700+
<NcHotkey label="Toggle unread" hotkey="U" />
701+
<NcHotkey label="Archive" hotkey="A" />
702+
<NcHotkey label="Delete" hotkey="Delete" />
703+
<NcHotkey label="Search" hotkey="Control F" />
704+
<NcHotkey label="Send" hotkey="Control Enter" />
705+
<NcHotkey label="Refresh" hotkey="R" />
706+
</NcHotkeyList>
707+
</NcAppSettingsSectionShortcuts>
693708
</NcAppSettingsDialog>
694709
</div>
695710
</template>

src/components/NcHotkey/NcHotkey.vue

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

4848
<style lang="scss" module>
4949
.hotkey {
50+
--form-element-label-offset: calc(var(--border-radius-element) + var(--default-grid-baseline));
5051
display: flex;
5152
flex-direction: row-reverse;
5253
align-items: stretch;
53-
padding-inline: var(--border-radius-element); /* Align with form group */
54+
padding-inline: var(--form-element-label-offset);
5455
5556
&:first-child {
5657
.hotkey__label,

src/components/NcHotkeyList/NcHotkeyList.vue

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

3434
<style module>
3535
.hotkeyList {
36+
--form-element-label-offset: calc(var(--border-radius-element) + var(--default-grid-baseline));
3637
/* Too wide list is less readable - 400px seems a good width */
3738
max-width: 400px;
3839
}
3940
4041
.hotkeyList__heading {
4142
font-weight: bold;
42-
margin-inline: var(--border-radius-element); /* Align with form group */
43+
margin-inline: var(--form-element-label-offset);
4344
}
4445
</style>
4546

0 commit comments

Comments
 (0)