force notifications and shortcuts to adhere to global scroll area
This commit is contained in:
parent
cfdd6f0b1d
commit
5237ee3135
@ -14,8 +14,6 @@ class DynamicShortcutsWidget : public QWidget {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors and destructors.
|
|
||||||
explicit DynamicShortcutsWidget(QWidget* parent = nullptr);
|
explicit DynamicShortcutsWidget(QWidget* parent = nullptr);
|
||||||
virtual ~DynamicShortcutsWidget();
|
virtual ~DynamicShortcutsWidget();
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "gui/settings/settingsshortcuts.h"
|
#include "gui/settings/settingsshortcuts.h"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QScrollArea>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
||||||
FormSettings::FormSettings(QWidget& parent)
|
FormSettings::FormSettings(QWidget& parent)
|
||||||
@ -134,31 +135,12 @@ void FormSettings::cancelSettings() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Scr : public QScrollBar {
|
|
||||||
public:
|
|
||||||
explicit Scr(QWidget* parent) : QScrollBar(parent) {}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void paintEvent(QPaintEvent* event) {
|
|
||||||
QScrollBar::paintEvent(event);
|
|
||||||
|
|
||||||
QPainter p(this);
|
|
||||||
|
|
||||||
p.setPen(QPen(Qt::GlobalColor::gray, 0.7));
|
|
||||||
|
|
||||||
p.drawRect(rect().marginsRemoved(QMargins(0, 0, 1, 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
void FormSettings::addSettingsPanel(SettingsPanel* panel) {
|
void FormSettings::addSettingsPanel(SettingsPanel* panel) {
|
||||||
m_ui.m_listSettings->addItem(panel->title());
|
m_ui.m_listSettings->addItem(panel->title());
|
||||||
m_panels.append(panel);
|
m_panels.append(panel);
|
||||||
|
|
||||||
QScrollArea* scr = new QScrollArea(m_ui.m_stackedSettings);
|
QScrollArea* scr = new QScrollArea(m_ui.m_stackedSettings);
|
||||||
|
|
||||||
//scr->setHorizontalScrollBar(new Scr(scr));
|
|
||||||
//scr->setVerticalScrollBar(new Scr(scr));
|
|
||||||
scr->setWidgetResizable(true);
|
scr->setWidgetResizable(true);
|
||||||
scr->setFrameShape(QFrame::Shape::Box);
|
scr->setFrameShape(QFrame::Shape::Box);
|
||||||
scr->setWidget(panel);
|
scr->setWidget(panel);
|
||||||
|
@ -8,13 +8,9 @@
|
|||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
NotificationsEditor::NotificationsEditor(QWidget* parent) : QScrollArea(parent), m_layout(new QVBoxLayout(this)) {
|
NotificationsEditor::NotificationsEditor(QWidget* parent) : QWidget(parent), m_layout(new QVBoxLayout(this)) {
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
setLayout(m_layout);
|
||||||
QWidget* wdg = new QWidget(this);
|
|
||||||
|
|
||||||
wdg->setLayout(m_layout);
|
|
||||||
setWidget(wdg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotificationsEditor::loadNotifications(const QList<Notification>& notifications) {
|
void NotificationsEditor::loadNotifications(const QList<Notification>& notifications) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#ifndef NOTIFICATIONSEDITOR_H
|
#ifndef NOTIFICATIONSEDITOR_H
|
||||||
#define NOTIFICATIONSEDITOR_H
|
#define NOTIFICATIONSEDITOR_H
|
||||||
|
|
||||||
#include <QScrollArea>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "ui_notificationseditor.h"
|
#include "ui_notificationseditor.h"
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
|
|
||||||
class NotificationsEditor : public QScrollArea {
|
class NotificationsEditor : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>NotificationsEditor</class>
|
<class>NotificationsEditor</class>
|
||||||
<widget class="QScrollArea" name="NotificationsEditor">
|
<widget class="QWidget" name="NotificationsEditor">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@ -10,12 +10,6 @@
|
|||||||
<height>300</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
@ -11,45 +11,11 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
|
||||||
<widget class="QScrollArea" name="m_scrollShortcuts">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="m_scrollShortcutsContents">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>767</width>
|
|
||||||
<height>508</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="DynamicShortcutsWidget" name="m_shortcuts" native="true"/>
|
<widget class="DynamicShortcutsWidget" name="m_shortcuts" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>DynamicShortcutsWidget</class>
|
<class>DynamicShortcutsWidget</class>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user