Skip to content

Commit

Permalink
Merge pull request #1091 from chat2db/refactor-electron
Browse files Browse the repository at this point in the history
style: electron win
  • Loading branch information
shanhexi authored Jan 9, 2024
2 parents 23bf439 + 63e512c commit 322ce83
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
5 changes: 3 additions & 2 deletions chat2db-client/src/blocks/AppTitleBar/index.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../styles/var.less';

.appTitleBar {
background-color: var(--color-primary-bg);
background-color: var(--color-bg-subtle);
-webkit-app-region: drag;
-webkit-user-select: none;
border-bottom: 1px solid var(--color-border);
Expand All @@ -18,8 +18,9 @@
height: 100%;
.appName {
flex: 1;
text-align: center;
text-align: start;
font-weight: bold;
padding-left: 6px;
}
.rightSlot,.leftSlot{
height: 100%;
Expand Down
14 changes: 7 additions & 7 deletions chat2db-client/src/blocks/AppTitleBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default memo<IProps>((props) => {
return window.electronApi?.getPlatform().isMac;
}, []);

// const isWin = true;
// const isMac = false;

const handleDoubleClick = () => {
window.electronApi?.setMaximize();
Expand All @@ -49,22 +49,22 @@ export default memo<IProps>((props) => {
return (
<div className={classnames(styles.appTitleBar, className)} onDoubleClick={handleDoubleClick}>
<div className={styles.appTitleBarGlobal}>
<div className={classnames({ [styles.windowsSpacer]: (!isMac && isMac !== void 0) }, styles.leftSlot)}>
{(!isMac && isMac !== void 0) && <BrandLogo size={20} className={styles.brandLogo} />}
<div className={classnames(styles.leftSlot)}>
<BrandLogo size={20} className={styles.brandLogo} />
</div>
<div className={styles.appName}>Chat2DB Community</div>
<div className={styles.appName}>Chat2DB</div>
<div className={styles.rightSlot}>{appTitleBarRightComponent}</div>
</div>
{(!isMac && isMac !== void 0) && (
<div className={styles.windowsCloseBar}>
<div className={styles.windowsCloseBarItem} onClick={handelMinimizeWindow}>
<Iconfont size={16} code="&#xe671;" />
<Iconfont size={13} code="&#xe671;" />
</div>
<div className={styles.windowsCloseBarItem} onClick={handelMaximize}>
{isMaximized ? <Iconfont code="&#xe66e;" /> : <Iconfont code="&#xe66b;" />}
{isMaximized ? <Iconfont size={13} code="&#xe66e;" /> : <Iconfont size={12} code="&#xe66b;" />}
</div>
<div className={styles.windowsCloseBarItem} onClick={handelCloseWindow}>
<Iconfont code="&#xe66f;" />
<Iconfont size={12} code="&#xe66f;" />
</div>
</div>
)}
Expand Down
6 changes: 4 additions & 2 deletions chat2db-client/src/components/CustomLayout/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
.customLayout {
display: flex;
align-items: center;
margin: 0px -3px;
.iconPanel {
display: flex;
align-items: center;
justify-content: center;
margin: 0px 5px;
margin: 0px 3px;
border-radius: 3px;
height: 20px;
width: 20px;
Expand All @@ -16,7 +17,8 @@
background-color: var(--color-hover-bg);
}
i {
font-size: 18px;
font-size: 15px;
color: var(--color-text-secondary);
}
}
}
2 changes: 1 addition & 1 deletion chat2db-client/src/pages/main/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
justify-content: space-between;
align-items: center;
width: 52px;
padding-top: 20px;
padding-top: 10px;
background-color: var(--color-bg-subtle);
border-right: 1px solid var(--color-border-secondary);
user-select: none;
Expand Down
2 changes: 1 addition & 1 deletion chat2db-client/src/pages/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function MainPage() {
return (
<div className={styles.page}>
<div className={styles.layoutLeft}>
{(isMac || isMac === void 0) && <BrandLogo size={40} className={styles.brandLogo} />}
{/* {(isMac || isMac === void 0) && <BrandLogo size={40} className={styles.brandLogo} />} */}
<ul className={styles.navList}>
{navConfig.map((item) => {
return (
Expand Down

0 comments on commit 322ce83

Please sign in to comment.