Skip to content

Commit

Permalink
feat(website filter view): add CodeEditor to website filter view
Browse files Browse the repository at this point in the history
- modified `website_blocker_view.ui` to use `CodeEditor` by replacing `PlainTextEdit` with `QFrame` in qtdesigner and then promoting them to `CodeEditor`
  • Loading branch information
kun-codes committed Oct 25, 2024
1 parent 79d8447 commit d53a7b4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
25 changes: 20 additions & 5 deletions pomodoro-task-app/ui/website_blocker_view.ui
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,24 @@
</layout>
</item>
<item>
<widget class="PlainTextEdit" name="blockListTextEdit"/>
<widget class="CodeEditor" name="blockListTextEdit">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="PlainTextEdit" name="allowListTextEdit"/>
<widget class="CodeEditor" name="allowListTextEdit">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
Expand Down Expand Up @@ -185,9 +199,10 @@
<header>qfluentwidgets</header>
</customwidget>
<customwidget>
<class>PlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header>qfluentwidgets</header>
<class>CodeEditor</class>
<extends>QFrame</extends>
<header>prefabs.codeEditor</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
Expand Down
19 changes: 12 additions & 7 deletions pomodoro-task-app/ui_py/ui_website_blocker_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################
## Form generated from reading UI file 'website_blocker_view.ui'
##
## Created by: Qt User Interface Compiler version 6.7.2
## Created by: Qt User Interface Compiler version 6.8.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -15,11 +15,12 @@
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QSizePolicy, QSpacerItem,
QVBoxLayout, QWidget)
from PySide6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QSizePolicy,
QSpacerItem, QVBoxLayout, QWidget)

from qfluentwidgets import (BodyLabel, ComboBox, PlainTextEdit, PrimaryPushButton,
PushButton, SingleDirectionScrollArea, TitleLabel, ToolButton)
from prefabs.codeEditor import CodeEditor
from qfluentwidgets import (BodyLabel, ComboBox, PrimaryPushButton, PushButton,
SingleDirectionScrollArea, TitleLabel, ToolButton)

class Ui_WebsiteBlockView(object):
def setupUi(self, WebsiteBlockView):
Expand Down Expand Up @@ -68,13 +69,17 @@ def setupUi(self, WebsiteBlockView):

self.verticalLayout.addLayout(self.horizontalLayout_2)

self.blockListTextEdit = PlainTextEdit(self.scrollAreaWidgetContents)
self.blockListTextEdit = CodeEditor(self.scrollAreaWidgetContents)
self.blockListTextEdit.setObjectName(u"blockListTextEdit")
self.blockListTextEdit.setFrameShape(QFrame.Shape.StyledPanel)
self.blockListTextEdit.setFrameShadow(QFrame.Shadow.Raised)

self.verticalLayout.addWidget(self.blockListTextEdit)

self.allowListTextEdit = PlainTextEdit(self.scrollAreaWidgetContents)
self.allowListTextEdit = CodeEditor(self.scrollAreaWidgetContents)
self.allowListTextEdit.setObjectName(u"allowListTextEdit")
self.allowListTextEdit.setFrameShape(QFrame.Shape.StyledPanel)
self.allowListTextEdit.setFrameShadow(QFrame.Shadow.Raised)

self.verticalLayout.addWidget(self.allowListTextEdit)

Expand Down

0 comments on commit d53a7b4

Please sign in to comment.