mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 13:04:37 +03:00
fix ui
This commit is contained in:
@@ -100,7 +100,14 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="inbound_socks_port"/>
|
<widget class="QLineEdit" name="inbound_socks_port">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -116,7 +123,14 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="inbound_http_port"/>
|
<widget class="QLineEdit" name="inbound_http_port">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="http_enable">
|
<widget class="QCheckBox" name="http_enable">
|
||||||
|
|||||||
@@ -158,6 +158,8 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="apply_to_group">
|
<widget class="QPushButton" name="apply_to_group">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Apply settings to this group</string>
|
<string>Apply settings to this group</string>
|
||||||
@@ -181,6 +183,8 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -1,16 +1,33 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <QEvent>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
|
||||||
class FloatCheckBox : public QCheckBox {
|
class FloatCheckBox : public QCheckBox {
|
||||||
public:
|
public:
|
||||||
explicit FloatCheckBox(QWidget *parent, QWidget *window) : QCheckBox(window) {
|
QWidget *parent;
|
||||||
|
QWidget *window;
|
||||||
|
|
||||||
|
void refresh() {
|
||||||
setFixedSize(24, 24);
|
setFixedSize(24, 24);
|
||||||
auto pos = parent->rect().topRight();
|
auto pos = parent->rect().topRight();
|
||||||
pos = parent->mapTo(window, pos);
|
pos = parent->mapTo(window, pos);
|
||||||
pos.setX(pos.x() - 48); // ?
|
pos.setX(pos.x() - 48); // ?
|
||||||
move(pos);
|
move(pos);
|
||||||
raise();
|
raise();
|
||||||
if (parent->isVisible()) show();
|
setVisible(parent->isVisible());
|
||||||
|
};
|
||||||
|
|
||||||
|
bool eventFilter(QObject *obj, QEvent *e) override {
|
||||||
|
if (obj != window || e->type() != QEvent::Resize) return false;
|
||||||
|
refresh();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
explicit FloatCheckBox(QWidget *parent, QWidget *window) : QCheckBox(window) {
|
||||||
|
this->parent = parent;
|
||||||
|
this->window = window;
|
||||||
|
window->installEventFilter(this);
|
||||||
|
refresh();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user