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

Commit

Permalink
feat: webui adjustments (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx authored Feb 17, 2021
1 parent dfa8a80 commit e1e92e4
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 21 deletions.
8 changes: 7 additions & 1 deletion src/models/dialog-store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ipcRenderer, remote } from 'electron';
import { observable, computed } from 'mobx';
import { observable, computed, makeObservable } from 'mobx';
import { getTheme } from '~/utils/themes';
import { ISettings } from '~/interfaces';
import { DEFAULT_SETTINGS } from '~/constants';
Expand Down Expand Up @@ -35,6 +35,12 @@ export class DialogStore {
persistent?: boolean;
} = {},
) {
makeObservable(this, {
theme: computed,
settings: observable,
visible: observable,
});

const { visibilityWrapper, hideOnBlur, persistent } = {
hideOnBlur: true,
visibilityWrapper: true,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/GlobalNavigationDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export const GlobalNavigationDrawer = () => {
<MenuItem name="bookmarks" icon={ICON_BOOKMARKS}>
Bookmarks
</MenuItem>
<MenuItem name="downloads" icon={ICON_DOWNLOAD}>
{/* <MenuItem name="downloads" icon={ICON_DOWNLOAD}>
Downloads
</MenuItem>
<MenuItem name="extensions" icon={ICON_EXTENSIONS}>
Extensions
</MenuItem>
</MenuItem> */}
</NavigationDrawer>
);
};
2 changes: 2 additions & 0 deletions src/renderer/views/app/components/Tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const onMouseEnter = (tab: ITab) => (e: React.MouseEvent<HTMLDivElement>) => {

const onMouseLeave = () => {
store.tabs.hoveredTabId = -1;
ipcRenderer.send(`hide-tab-preview-${store.windowId}`);
store.tabs.canShowPreview = true;
};

const onClick = (tab: ITab) => (e: React.MouseEvent<HTMLDivElement>) => {
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/views/app/components/Tabbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const onTabsMouseLeave = () => {
store.tabs.removedTabs = 0;
store.tabs.updateTabsBounds(true);
}, 300);
ipcRenderer.send(`hide-tab-preview-${store.windowId}`);
store.tabs.canShowPreview = true;
};

const onAddTabClick = () => {
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/views/newtab/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default observer(() => {
icon={ICON_BOOKMARKS}
onClick={onIconClick('bookmarks')}
></IconItem>
<IconItem
{/* <IconItem
imageSet={store.imageVisible}
title="Downloads"
icon={ICON_DOWNLOAD}
Expand All @@ -90,15 +90,15 @@ export default observer(() => {
title="Extensions"
icon={ICON_EXTENSIONS}
onClick={onIconClick('extensions')}
></IconItem>
></IconItem> */}
</Menu>
)}
</Wrapper>
{store.newsBehavior !== 'hidden' && (
{/* {store.newsBehavior !== 'hidden' && (
<Content>
<News></News>
</Content>
)}
)} */}
</div>
</ThemeProvider>
);
Expand Down
11 changes: 6 additions & 5 deletions src/renderer/views/newtab/components/Preferences/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ export const Preferences = observer(() => {
>
Inspirational
</ContextMenuItem>
<ContextMenuItem
{/* <ContextMenuItem
bigger
onClick={onPresetClick('informational')}
selected={store.preset === 'informational'}
iconSize={28}
icon={ICON_WINDOW}
>
Informational
</ContextMenuItem>
</ContextMenuItem> */}
<ContextMenuItem
bigger
selected={store.preset === 'custom'}
Expand All @@ -137,7 +137,8 @@ export const Preferences = observer(() => {
pointerEvents:
store.preferencesContent === 'custom' ? 'inherit' : 'none',
transition: '0.3s max-height, 0.3s transform, 0.3s opacity',
maxHeight: store.preferencesContent === 'custom' ? 390 : 200,
// maxHeight: store.preferencesContent === 'custom' ? 390 : 200,
maxHeight: store.preferencesContent === 'custom' ? 300 : 150,
transform:
store.preferencesContent === 'custom'
? 'translateX(-100%)'
Expand All @@ -162,7 +163,7 @@ export const Preferences = observer(() => {
<ContextMenuSeparator bigger></ContextMenuSeparator>
<SwitchItem name="topSitesVisible">Show top sites</SwitchItem>
<SwitchItem name="quickMenuVisible">Show quick menu</SwitchItem>
<ContextMenuSeparator bigger></ContextMenuSeparator>
{/* <ContextMenuSeparator bigger></ContextMenuSeparator>
<SubTitle>News visibility:</SubTitle>
<Dropdown
defaultValue={store.newsBehavior}
Expand All @@ -173,7 +174,7 @@ export const Preferences = observer(() => {
<Dropdown.Item value="always-visible">Always visible</Dropdown.Item>
<Dropdown.Item value="hidden">Hidden</Dropdown.Item>
<Dropdown.Item value="on-scroll">Visible on scroll</Dropdown.Item>
</Dropdown>
</Dropdown> */}
</div>
</div>
</ContextMenu>
Expand Down
15 changes: 8 additions & 7 deletions src/renderer/views/newtab/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class Store {

@computed
public get fullSizeImage() {
return this.newsBehavior === 'on-scroll' || this.newsBehavior === 'hidden';
// return this.newsBehavior === 'on-scroll' || this.newsBehavior === 'hidden';
return true;
}

@observable
Expand Down Expand Up @@ -169,13 +170,13 @@ export class Store {

this.loadTopSites();

window.onscroll = () => {
this.updateNews();
};
// window.onscroll = () => {
// this.updateNews();
// };

window.onresize = () => {
this.updateNews();
};
// window.onresize = () => {
// this.updateNews();
// };
}

public async loadImage() {
Expand Down

0 comments on commit e1e92e4

Please sign in to comment.