Merge pull request #1142 from Mikunj/height-fix

Update minimum height to 600px
pull/1156/head
Mikunj Varsani 5 years ago committed by GitHub
commit e70c9062f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -206,19 +206,33 @@ function captureClicks(window) {
window.webContents.on('new-window', handleUrl); window.webContents.on('new-window', handleUrl);
} }
const DEFAULT_WIDTH = 880; const WINDOW_SIZE = Object.freeze({
// add contact button needs to be visible (on HiDpi screens?) defaultWidth: 880,
// otherwise integration test fail defaultHeight: 820,
const DEFAULT_HEIGHT = 820; minWidth: 880,
const MIN_WIDTH = 880; minHeight: 600,
const MIN_HEIGHT = 820; });
const BOUNDS_BUFFER = 100;
function getWindowSize() {
const { screen } = electron;
const screenSize = screen.getPrimaryDisplay().workAreaSize;
const { minWidth, minHeight, defaultWidth, defaultHeight } = WINDOW_SIZE;
// Ensure that the screen can fit within the default size
const width = Math.min(defaultWidth, Math.max(minWidth, screenSize.width));
const height = Math.min(
defaultHeight,
Math.max(minHeight, screenSize.height)
);
return { width, height, minWidth, minHeight };
}
function isVisible(window, bounds) { function isVisible(window, bounds) {
const boundsX = _.get(bounds, 'x') || 0; const boundsX = _.get(bounds, 'x') || 0;
const boundsY = _.get(bounds, 'y') || 0; const boundsY = _.get(bounds, 'y') || 0;
const boundsWidth = _.get(bounds, 'width') || DEFAULT_WIDTH; const boundsWidth = _.get(bounds, 'width') || WINDOW_SIZE.defaultWidth;
const boundsHeight = _.get(bounds, 'height') || DEFAULT_HEIGHT; const boundsHeight = _.get(bounds, 'height') || WINDOW_SIZE.defaultHeight;
const BOUNDS_BUFFER = 100;
// requiring BOUNDS_BUFFER pixels on the left or right side // requiring BOUNDS_BUFFER pixels on the left or right side
const rightSideClearOfLeftBound = const rightSideClearOfLeftBound =
@ -241,13 +255,14 @@ function isVisible(window, bounds) {
async function createWindow() { async function createWindow() {
const { screen } = electron; const { screen } = electron;
const { minWidth, minHeight, width, height } = getWindowSize();
const windowOptions = Object.assign( const windowOptions = Object.assign(
{ {
show: !startInTray, // allow to start minimised in tray show: !startInTray, // allow to start minimised in tray
width: DEFAULT_WIDTH, width,
height: DEFAULT_HEIGHT, height,
minWidth: MIN_WIDTH, minWidth,
minHeight: MIN_HEIGHT, minHeight,
autoHideMenuBar: false, autoHideMenuBar: false,
backgroundColor: '#fff', backgroundColor: '#fff',
webPreferences: { webPreferences: {
@ -270,11 +285,11 @@ async function createWindow() {
]) ])
); );
if (!_.isNumber(windowOptions.width) || windowOptions.width < MIN_WIDTH) { if (!_.isNumber(windowOptions.width) || windowOptions.width < minWidth) {
windowOptions.width = DEFAULT_WIDTH; windowOptions.width = Math.max(minWidth, width);
} }
if (!_.isNumber(windowOptions.height) || windowOptions.height < MIN_HEIGHT) { if (!_.isNumber(windowOptions.height) || windowOptions.height < minHeight) {
windowOptions.height = DEFAULT_HEIGHT; windowOptions.height = Math.max(minHeight, height);
} }
if (!_.isBoolean(windowOptions.maximized)) { if (!_.isBoolean(windowOptions.maximized)) {
delete windowOptions.maximized; delete windowOptions.maximized;
@ -516,13 +531,13 @@ function showPasswordWindow() {
passwordWindow.show(); passwordWindow.show();
return; return;
} }
const { minWidth, minHeight, width, height } = getWindowSize();
const windowOptions = { const windowOptions = {
show: true, // allow to start minimised in tray show: true, // allow to start minimised in tray
width: DEFAULT_WIDTH, width,
height: DEFAULT_HEIGHT, height,
minWidth: MIN_WIDTH, minWidth,
minHeight: MIN_HEIGHT, minHeight,
autoHideMenuBar: false, autoHideMenuBar: false,
webPreferences: { webPreferences: {
nodeIntegration: false, nodeIntegration: false,
@ -631,8 +646,8 @@ async function showDebugLogWindow() {
const theme = await getThemeFromMainWindow(); const theme = await getThemeFromMainWindow();
const size = mainWindow.getSize(); const size = mainWindow.getSize();
const options = { const options = {
width: Math.max(size[0] - 100, MIN_WIDTH), width: Math.max(size[0] - 100, WINDOW_SIZE.minWidth),
height: Math.max(size[1] - 100, MIN_HEIGHT), height: Math.max(size[1] - 100, WINDOW_SIZE.minHeight),
resizable: false, resizable: false,
title: locale.messages.signalDesktopPreferences.message, title: locale.messages.signalDesktopPreferences.message,
autoHideMenuBar: true, autoHideMenuBar: true,

@ -558,7 +558,9 @@ label {
max-width: 70vw; max-width: 70vw;
background-color: $session-shade-4; background-color: $session-shade-4;
border: 1px solid $session-shade-8; border: 1px solid $session-shade-8;
padding-bottom: $session-margin-lg; overflow: hidden;
display: flex;
flex-direction: column;
&__header { &__header {
display: flex; display: flex;
@ -609,6 +611,8 @@ label {
font-family: $session-font-accent; font-family: $session-font-accent;
line-height: $session-font-md; line-height: $session-font-md;
font-size: $session-font-sm; font-size: $session-font-sm;
overflow-y: auto;
overflow-x: hidden;
.message { .message {
text-align: center; text-align: center;
@ -1061,7 +1065,8 @@ label {
flex-direction: column; flex-direction: column;
&-list { &-list {
overflow-y: scroll; overflow-y: auto;
overflow-x: hidden;
} }
&-header { &-header {
@ -1131,6 +1136,7 @@ label {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
overflow: hidden;
} }
&__version-info { &__version-info {
@ -1566,6 +1572,13 @@ input {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
} }
// Height at which scroll bar appears on the group member list
@media (max-height: 804px) {
&__container {
overflow-y: visible;
}
}
} }
.create-group-name-input { .create-group-name-input {
.session-id-editable { .session-id-editable {

@ -239,7 +239,8 @@ $session-compose-margin: 20px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: -webkit-fill-available; overflow-y: auto;
overflow-x: hidden;
.session-icon .exit { .session-icon .exit {
padding: 13px; padding: 13px;
} }
@ -339,7 +340,8 @@ $session-compose-margin: 20px;
.session-left-pane-section-content { .session-left-pane-section-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 1; flex: 1;
overflow: hidden;
} }
.user-search-dropdown { .user-search-dropdown {
@ -404,8 +406,6 @@ $session-compose-margin: 20px;
@mixin bottom-buttons() { @mixin bottom-buttons() {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
position: absolute;
bottom: 2px;
width: 100%; width: 100%;
@at-root .light-theme #{&} { @at-root .light-theme #{&} {
@ -471,7 +471,8 @@ $session-compose-margin: 20px;
&-content { &-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 1; overflow: hidden;
flex: 1;
.module-conversation-list-item { .module-conversation-list-item {
background-color: $session-shade-4; background-color: $session-shade-4;

@ -10,6 +10,7 @@
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column;
&-accent { &-accent {
flex-grow: 1; flex-grow: 1;
@ -28,21 +29,32 @@
} }
&-registration { &-registration {
height: 45%;
padding-right: 128px; padding-right: 128px;
} }
&-header {
display: flex;
flex-direction: row;
width: 100%;
justify-content: space-between;
padding: 17px 20px;
}
&-body {
display: flex;
flex-direction: row;
flex: 1;
align-items: center;
width: 100%;
padding-bottom: 20px;
}
&-close-button { &-close-button {
position: absolute; display: flex;
top: 17px; align-items: center;
left: 20px;
} }
&-session-button { &-session-button {
position: absolute;
top: 17px;
right: 20px;
img { img {
width: 30px; width: 30px;
} }
@ -246,6 +258,8 @@
display: inline-block; display: inline-block;
font-family: $session-font-mono; font-family: $session-font-mono;
user-select: all; user-select: all;
overflow: hidden;
resize: none;
} }
} }
} }

@ -8,6 +8,7 @@ export const SessionRegistrationView: React.FC = () => (
<div className="session-content"> <div className="session-content">
<div id="session-toast-container" /> <div id="session-toast-container" />
<div id="error" className="collapse" /> <div id="error" className="collapse" />
<div className="session-content-header">
<div className="session-content-close-button"> <div className="session-content-close-button">
<SessionIconButton <SessionIconButton
iconSize={SessionIconSize.Medium} iconSize={SessionIconSize.Medium}
@ -17,15 +18,17 @@ export const SessionRegistrationView: React.FC = () => (
}} }}
/> />
</div> </div>
<div className="session-content-session-button">
<img alt="brand" src="./images/session/brand.svg" />
</div>
</div>
<div className="session-content-body">
<div className="session-content-accent"> <div className="session-content-accent">
<AccentText /> <AccentText />
</div> </div>
<div className="session-content-registration"> <div className="session-content-registration">
<RegistrationTabs /> <RegistrationTabs />
</div> </div>
<div className="session-content-session-button">
<img alt="brand" src="./images/session/brand.svg" />
</div> </div>
</div> </div>
); );

Loading…
Cancel
Save