mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
Allow window sizes smaller than 400x400
This commit is contained in:
parent
1df1b5037e
commit
e077bdbdd5
4 changed files with 17 additions and 12 deletions
|
@ -32,6 +32,7 @@ Rectangle {
|
||||||
|
|
||||||
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false
|
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
ImageButton {
|
ImageButton {
|
||||||
visible: CallManager.callsSupported
|
visible: CallManager.callsSupported
|
||||||
|
@ -88,8 +89,13 @@ Rectangle {
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.maximumHeight: Window.height / 4
|
Layout.maximumHeight: Window.height / 4
|
||||||
Layout.minimumHeight: Settings.fontSize
|
Layout.minimumHeight: fontMetrics.lineSpacing
|
||||||
implicitWidth: inputBar.width - 5 * (22 + 16) - 24
|
Layout.preferredHeight: contentHeight
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
|
||||||
|
contentWidth: availableWidth
|
||||||
|
|
||||||
TextArea {
|
TextArea {
|
||||||
id: messageInput
|
id: messageInput
|
||||||
|
@ -124,7 +130,9 @@ Rectangle {
|
||||||
width: textInput.width
|
width: textInput.width
|
||||||
verticalAlignment: TextEdit.AlignVCenter
|
verticalAlignment: TextEdit.AlignVCenter
|
||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
padding: 8
|
padding: 0
|
||||||
|
topPadding: 8
|
||||||
|
bottomPadding: 8
|
||||||
focus: true
|
focus: true
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
if (room)
|
if (room)
|
||||||
|
|
|
@ -39,9 +39,6 @@ constexpr int labelSize = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace modals {
|
namespace modals {
|
||||||
constexpr int MIN_WIDGET_WIDTH = 400;
|
|
||||||
constexpr int MIN_WIDGET_HEIGHT = 400;
|
|
||||||
|
|
||||||
constexpr int WIDGET_MARGIN = 20;
|
constexpr int WIDGET_MARGIN = 20;
|
||||||
constexpr int WIDGET_SPACING = 15;
|
constexpr int WIDGET_SPACING = 15;
|
||||||
constexpr int WIDGET_TOP_MARGiN = 2 * WIDGET_MARGIN;
|
constexpr int WIDGET_TOP_MARGiN = 2 * WIDGET_MARGIN;
|
||||||
|
@ -76,8 +73,8 @@ constexpr int height = 600;
|
||||||
constexpr int width = 1066;
|
constexpr int width = 1066;
|
||||||
constexpr int minModalWidth = 340;
|
constexpr int minModalWidth = 340;
|
||||||
|
|
||||||
constexpr int minHeight = height;
|
constexpr int minHeight = 340;
|
||||||
constexpr int minWidth = 950;
|
constexpr int minWidth = 340;
|
||||||
} // namespace window
|
} // namespace window
|
||||||
|
|
||||||
namespace textInput {
|
namespace textInput {
|
||||||
|
|
|
@ -70,8 +70,8 @@ MainWindow::MainWindow(QWindow *parent)
|
||||||
MainWindow::setWindowTitle(0);
|
MainWindow::setWindowTitle(0);
|
||||||
setObjectName(QStringLiteral("MainWindow"));
|
setObjectName(QStringLiteral("MainWindow"));
|
||||||
setResizeMode(QQuickView::SizeRootObjectToView);
|
setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
setMinimumHeight(400);
|
setMinimumHeight(conf::window::minHeight);
|
||||||
setMinimumWidth(400);
|
setMinimumWidth(conf::window::minWidth);
|
||||||
restoreWindowSize();
|
restoreWindowSize();
|
||||||
|
|
||||||
chat_page_ = new ChatPage(userSettings_, this);
|
chat_page_ = new ChatPage(userSettings_, this);
|
||||||
|
|
|
@ -28,7 +28,7 @@ CreateRoom::CreateRoom(QWidget *parent)
|
||||||
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5);
|
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5);
|
||||||
|
|
||||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||||
setMinimumHeight(conf::modals::MIN_WIDGET_HEIGHT);
|
setMinimumHeight(conf::window::minHeight);
|
||||||
setMinimumWidth(conf::window::minModalWidth);
|
setMinimumWidth(conf::window::minModalWidth);
|
||||||
|
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
|
|
Loading…
Reference in a new issue