Skip to content

Commit

Permalink
修改UI内容
Browse files Browse the repository at this point in the history
  • Loading branch information
MingYueRuYa committed Oct 16, 2024
1 parent 69ee94d commit 7781874
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 61 deletions.
42 changes: 12 additions & 30 deletions WindbgIFEO/WindbgIFEO.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@
<x>0</x>
<y>0</y>
<width>1167</width>
<height>721</height>
<height>740</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1167</width>
<height>600</height>
<height>700</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1167</width>
<height>771</height>
<height>740</height>
</size>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -605,7 +611,7 @@ font-size: 12px;</string>
</property>
<property name="minimumSize">
<size>
<width>210</width>
<width>150</width>
<height>25</height>
</size>
</property>
Expand Down Expand Up @@ -688,7 +694,7 @@ font-size: 13px;</string>
<widget class="QLineEdit" name="lineEdit_process_param">
<property name="minimumSize">
<size>
<width>0</width>
<width>170</width>
<height>25</height>
</size>
</property>
Expand Down Expand Up @@ -980,7 +986,7 @@ font-size: 13px;</string>
</property>
<property name="minimumSize">
<size>
<width>210</width>
<width>150</width>
<height>25</height>
</size>
</property>
Expand Down Expand Up @@ -1042,19 +1048,6 @@ border-radius:12px;
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -1582,17 +1575,6 @@ border:0px;
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<property name="styleSheet">
<string notr="true">font-family: &quot;Microsoft YaHei&quot;;
font-size: 12px;</string>
</property>
<property name="text">
<string>Operation log:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowserLog">
<property name="styleSheet">
Expand Down
38 changes: 19 additions & 19 deletions WindbgIFEO/round_shadow_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ RoundShadowWidget::RoundShadowWidget(QWidget* parent) : QWidget(parent) {
}

RoundShadowWidget::RoundShadowWidget(const int shadow_width,
const int radius,
QWidget* parent)
: RoundShadowHelper(shadow_width, radius), QWidget(parent) {}
const int radius,
QWidget* parent)
: RoundShadowHelper(shadow_width, radius), QWidget(parent) {}

void RoundShadowWidget::paintEvent(QPaintEvent* ev) {
const int kBORDER_DISTANCE = shadow_width_ / 2;
Expand All @@ -35,22 +35,22 @@ void RoundShadowWidget::paintEvent(QPaintEvent* ev) {

RoundShadow(&painter, QRect(0, 0, this->width(), this->height()));
QRect rect(kBORDER_DISTANCE, kBORDER_DISTANCE,
this->width() - kBORDER_DISTANCE * 2,
this->height() - kBORDER_DISTANCE * 2);
this->width() - kBORDER_DISTANCE * 2,
this->height() - kBORDER_DISTANCE * 2);
FillRoundShadow(&painter, rect, Qt::white, radius_);
}

void RoundShadowWidget::mousePressEvent(QMouseEvent* event) {
this->raise();
move_widget_helper_.mousePressEvent(event, pos());
}

void RoundShadowWidget::mouseReleaseEvent(QMouseEvent* event) {
move_widget_helper_.mouseReleaseEvent(event);
}

void RoundShadowWidget::mouseMoveEvent(QMouseEvent* event) {
if (move_widget_helper_.CanMove()) {
move(move_widget_helper_.mouseMoveEvent(event));
}
}
//void RoundShadowWidget::mousePressEvent(QMouseEvent* event) {
// this->raise();
// move_widget_helper_.mousePressEvent(event, pos());
//}
//
//void RoundShadowWidget::mouseReleaseEvent(QMouseEvent* event) {
// move_widget_helper_.mouseReleaseEvent(event);
//}
//
//void RoundShadowWidget::mouseMoveEvent(QMouseEvent* event) {
// if (move_widget_helper_.CanMove()) {
// move(move_widget_helper_.mouseMoveEvent(event));
// }
//}
24 changes: 12 additions & 12 deletions WindbgIFEO/round_shadow_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ class QPaintEvent;
class RoundShadowWidget : public QWidget, public RoundShadowHelper {
Q_OBJECT

public:
public:
explicit RoundShadowWidget(QWidget* parent = nullptr);
explicit RoundShadowWidget(const int shadow_width,
const int radius,
QWidget* parent = nullptr);
const int radius,
QWidget* parent = nullptr);
~RoundShadowWidget() = default;

protected:
protected:
virtual void paintEvent(QPaintEvent* ev);
virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void mouseMoveEvent(QMouseEvent* event);

private:
bool is_press_ = false;
QPoint move_point_;
MoveWidgetHelper move_widget_helper_;
//virtual void mousePressEvent(QMouseEvent* event);
//virtual void mouseReleaseEvent(QMouseEvent* event);
//virtual void mouseMoveEvent(QMouseEvent* event);

private:
//bool is_press_ = false;
//QPoint move_point_;
//MoveWidgetHelper move_widget_helper_;
};

#endif // ROUND_SHADOW_WIDGET

0 comments on commit 7781874

Please sign in to comment.