mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-05 20:03:31 +01:00
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
|
||||
|
||||
public:
|
||||
|
||||
// Constructors and destructors.
|
||||
explicit DynamicShortcutsWidget(QWidget* parent = nullptr);
|
||||
virtual ~DynamicShortcutsWidget();
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "gui/settings/settingsshortcuts.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QScrollArea>
|
||||
#include <QScrollBar>
|
||||
|
||||
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) {
|
||||
m_ui.m_listSettings->addItem(panel->title());
|
||||
m_panels.append(panel);
|
||||
|
||||
QScrollArea* scr = new QScrollArea(m_ui.m_stackedSettings);
|
||||
|
||||
//scr->setHorizontalScrollBar(new Scr(scr));
|
||||
//scr->setVerticalScrollBar(new Scr(scr));
|
||||
scr->setWidgetResizable(true);
|
||||
scr->setFrameShape(QFrame::Shape::Box);
|
||||
scr->setWidget(panel);
|
||||
|
@ -8,13 +8,9 @@
|
||||
|
||||
#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);
|
||||
|
||||
QWidget* wdg = new QWidget(this);
|
||||
|
||||
wdg->setLayout(m_layout);
|
||||
setWidget(wdg);
|
||||
setLayout(m_layout);
|
||||
}
|
||||
|
||||
void NotificationsEditor::loadNotifications(const QList<Notification>& notifications) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
#ifndef NOTIFICATIONSEDITOR_H
|
||||
#define NOTIFICATIONSEDITOR_H
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QWidget>
|
||||
|
||||
#include "ui_notificationseditor.h"
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
class QVBoxLayout;
|
||||
|
||||
class NotificationsEditor : public QScrollArea {
|
||||
class NotificationsEditor : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>NotificationsEditor</class>
|
||||
<widget class="QScrollArea" name="NotificationsEditor">
|
||||
<widget class="QWidget" name="NotificationsEditor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -10,12 +10,6 @@
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -12,41 +12,7 @@
|
||||
</property>
|
||||
<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>
|
||||
<widget class="DynamicShortcutsWidget" name="m_shortcuts" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="DynamicShortcutsWidget" name="m_shortcuts" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user