Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
feat: tab selected hover
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx committed May 5, 2020
1 parent ea898d3 commit faa9975
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/renderer/views/app/components/Tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const onClick = (tab: ITab) => (e: React.MouseEvent<HTMLDivElement>) => {
return;
}

if (e.button === 0 && store.canOpenSearch) {
if (store.isCompact && e.button === 0 && store.canOpenSearch) {
store.inputRef.focus();
store.canOpenSearch = false;
}
Expand Down Expand Up @@ -286,6 +286,10 @@ export default observer(({ tab }: { tab: ITab }) => {
? 'rgba(255, 255, 255, 0.08)'
: 'rgba(255, 255, 255, 0.5)';

const defaultSelectedHoverColor = store.theme['toolbar.lightForeground']
? '#393939'
: '#fcfcfc';

return (
<StyledTab
selected={tab.isSelected}
Expand All @@ -303,7 +307,9 @@ export default observer(({ tab }: { tab: ITab }) => {
selected={tab.isSelected}
style={{
backgroundColor: tab.isSelected
? store.theme['toolbar.backgroundColor']
? store.isCompact && tab.isHovered
? defaultSelectedHoverColor
: store.theme['toolbar.backgroundColor']
: tab.isHovered
? defaultHoverColor
: defaultColor,
Expand Down

0 comments on commit faa9975

Please sign in to comment.