Fix positioning of buttons

This commit is contained in:
Henrik Giesel 2021-02-27 17:22:55 +01:00
parent 81d1f2906a
commit a66b0fbd84
2 changed files with 11 additions and 8 deletions

View file

@ -179,19 +179,16 @@ class Editor:
"colour", "colour",
tr(TR.EDITING_SET_FOREGROUND_COLOUR_F7), tr(TR.EDITING_SET_FOREGROUND_COLOUR_F7),
""" """
<div id="forecolor" <span id="forecolor" class="topbut topbut--rounded" style="background: #000"></span>
style="display: inline-block; background: #000; border-radius: 5px;" """
class="topbut"
>""",
), ),
self._addButton( self._addButton(
None, None,
"changeCol", "changeCol",
tr(TR.EDITING_CHANGE_COLOUR_F8), tr(TR.EDITING_CHANGE_COLOUR_F8),
""" """
<div style="display: inline-block; border-radius: 5px;" <span class="topbut topbut--rounded rainbow"></span>
class="topbut rainbow" """
>""",
), ),
self._addButton( self._addButton(
"text_cloze", "cloze", tr(TR.EDITING_CLOZE_DELETION_CTRLANDSHIFTANDC) "text_cloze", "cloze", tr(TR.EDITING_CLOZE_DELETION_CTRLANDSHIFTANDC)
@ -321,7 +318,7 @@ class Editor:
else: else:
imgelm = "" imgelm = ""
if label or not imgelm: if label or not imgelm:
labelelm = f"""<span class=blabel>{label or cmd}</span>""" labelelm = label or cmd
else: else:
labelelm = "" labelelm = ""
if id: if id:

View file

@ -56,9 +56,15 @@ body {
} }
.topbut { .topbut {
display: inline-block;
width: 16px; width: 16px;
height: 16px; height: 16px;
margin-top: 4px; margin-top: 4px;
vertical-align: -.125em;
}
.topbut--rounded {
border-radius: 5px;
} }
.rainbow { .rainbow {