Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Adjust dropdown menu item layout for better text fitting #3159

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const CALLS_PLUGIN_ID = 'com.mattermost.calls';
export const DOWNLOADS_DROPDOWN_HEIGHT = 360;
export const DOWNLOADS_DROPDOWN_WIDTH = 280;
export const DOWNLOADS_DROPDOWN_PADDING = 24;
export const DOWNLOADS_DROPDOWN_MENU_HEIGHT = 160;
export const DOWNLOADS_DROPDOWN_MENU_WIDTH = 154;
export const DOWNLOADS_DROPDOWN_MENU_HEIGHT = 500;
export const DOWNLOADS_DROPDOWN_MENU_WIDTH = 200;
export const DOWNLOADS_DROPDOWN_MENU_PADDING = 12;

// In order to display the box-shadow & radius on the left + right, use this WIDTH in the browserView for downloadsDropdown
Expand Down
1 change: 1 addition & 0 deletions src/main/views/downloadsDropdownMenuView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class DownloadsDropdownMenuView {
// @ts-ignore
transparent: true,
}});
this.view.setAutoResize({height: true});
this.view.webContents.loadURL('mattermost-desktop://renderer/downloadsDropdownMenu.html');
MainWindow.get()?.addBrowserView(this.view);
};
Expand Down
17 changes: 11 additions & 6 deletions src/renderer/css/downloadsDropdownMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ body {
background-color: transparent;
font-family: Open Sans;
overflow: hidden;
height: 172px; // 160 + 12
width: 176px; // 154 + 12
height: auto;
width: 224px;

#app {
background-color: transparent;
Expand All @@ -40,9 +40,10 @@ body {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
padding: 8px 0px;
width: 100%;
height: auto;
max-height: none;

.DownloadsDropdownMenu__MenuItem {
align-items: center;
Expand All @@ -52,9 +53,12 @@ body {
display: flex;
font-size: 14px;
font-weight: 400;
height: 25%;
flex-grow: 1;
height: fit-content(25%);
justify-content: flex-start;
padding-left: 20px;
padding: 8px 20px;
min-height: 36px;
width: 100%;

&:hover {
background-color: rgba(63, 67, 80, 0.08);
Expand All @@ -67,6 +71,7 @@ body {
}
}


&.darkMode {
background: #1f1f1f;
border: 1px solid rgba(221, 223, 228, 0.16);
Expand All @@ -87,4 +92,4 @@ body {
}
}
}
}
}