mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont use zoom for hover on top bar buttons as it makes it ignore clicks if the mouse is close to the border
This commit is contained in:
parent
b54dfb6db6
commit
02170b067f
@ -22,10 +22,10 @@ class TopBar:
|
|||||||
for sel in (self.dummy_bar_id, self.bar_id):
|
for sel in (self.dummy_bar_id, self.bar_id):
|
||||||
sel = '#' + sel + ' a'
|
sel = '#' + sel + ' a'
|
||||||
style += build_rule(
|
style += build_rule(
|
||||||
sel, display='inline-block', vertical_align='text-top', overflow='hidden', cursor='pointer',
|
sel, display='inline-block', vertical_align='middle', overflow='hidden', cursor='pointer',
|
||||||
border='none', color=get_color('bar-foreground'), background='none'
|
color=get_color('bar-foreground'), background='none', padding_top=self.VSPACING, padding_bottom=self.VSPACING
|
||||||
)
|
)
|
||||||
style += build_rule(sel + ':hover', transform='scale(1.4)')
|
style += build_rule(sel + ':hover', color=get_color('bar-background'), background_color=get_color('bar-foreground'))
|
||||||
style += build_rule(sel + ':active', transform='scale(0.6)')
|
style += build_rule(sel + ':active', transform='scale(0.6)')
|
||||||
style += build_rule(sel + ':focus', outline='none')
|
style += build_rule(sel + ':focus', outline='none')
|
||||||
for bid in self.dummy_bar_id, self.bar_id:
|
for bid in self.dummy_bar_id, self.bar_id:
|
||||||
@ -39,7 +39,7 @@ class TopBar:
|
|||||||
bar.appendChild(E.style(style, type='text/css'))
|
bar.appendChild(E.style(style, type='text/css'))
|
||||||
set_css(bar,
|
set_css(bar,
|
||||||
width='100%', display='flex', flex_direction='row', flex_wrap='wrap', justify_content='space-between',
|
width='100%', display='flex', flex_direction='row', flex_wrap='wrap', justify_content='space-between',
|
||||||
font_size=get_font_size('title'), padding_top=self.VSPACING, padding_bottom=self.VSPACING, user_select='none',
|
font_size=get_font_size('title'), user_select='none',
|
||||||
color=get_color('bar-foreground'), background_color=get_color('bar-background')
|
color=get_color('bar-foreground'), background_color=get_color('bar-background')
|
||||||
)
|
)
|
||||||
document.body.appendChild(bar)
|
document.body.appendChild(bar)
|
||||||
@ -61,7 +61,7 @@ class TopBar:
|
|||||||
left = bar.firstChild
|
left = bar.firstChild
|
||||||
clear(left)
|
clear(left)
|
||||||
left.appendChild(E.a(title=tooltip, E.i(class_='fa fa-' + icon_name + ' fa-fw')))
|
left.appendChild(E.a(title=tooltip, E.i(class_='fa fa-' + icon_name + ' fa-fw')))
|
||||||
left.appendChild(E.span(title, style=str.format('margin-left: {}; font-weight: bold;', self.SPACING)))
|
left.appendChild(E.span(title, style=str.format('margin-left: {0}; font-weight: bold; padding-top: {1}; padding-bottom: {1}', self.SPACING, self.VSPACING)))
|
||||||
if bar is self.bar:
|
if bar is self.bar:
|
||||||
a = left.firstChild
|
a = left.firstChild
|
||||||
if icon_name == 'heart':
|
if icon_name == 'heart':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user