This commit is contained in:
arm64v8a
2023-05-15 11:09:01 +09:00
parent 1f7a0825a0
commit d769723b23
3 changed files with 39 additions and 4 deletions

View File

@@ -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">

View File

@@ -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>

View File

@@ -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();
}; };
}; };