Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm-play-gui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roman Alifanov
eepm-play-gui
Commits
addbc84e
Unverified
Commit
addbc84e
authored
Oct 08, 2024
by
Vladimir Vaskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add searchbar
The search bar will appear as you type
parent
346e6db9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
15 deletions
+37
-15
window.py
src/window.py
+2
-5
window.ui
src/window.ui
+35
-10
No files found.
src/window.py
View file @
addbc84e
...
@@ -89,6 +89,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -89,6 +89,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
is_loading
=
GObject
.
Property
(
type
=
bool
,
default
=
True
)
is_loading
=
GObject
.
Property
(
type
=
bool
,
default
=
True
)
search_entry
=
Gtk
.
Template
.
Child
()
search_entry
=
Gtk
.
Template
.
Child
()
search_bar
=
Gtk
.
Template
.
Child
()
search_toggle_button
=
Gtk
.
Template
.
Child
()
search_toggle_button
=
Gtk
.
Template
.
Child
()
main_stack
=
Gtk
.
Template
.
Child
()
main_stack
=
Gtk
.
Template
.
Child
()
search_dropdown
=
Gtk
.
Template
.
Child
()
search_dropdown
=
Gtk
.
Template
.
Child
()
...
@@ -103,7 +104,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -103,7 +104,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
apply_button
.
connect
(
"activated"
,
self
.
on_apply_clicked
)
self
.
apply_button
.
connect
(
"activated"
,
self
.
on_apply_clicked
)
self
.
connect
(
"notify::is-loading"
,
self
.
on_is_loading_changed
)
self
.
connect
(
"notify::is-loading"
,
self
.
on_is_loading_changed
)
self
.
search_
toggle_button
.
connect
(
"notify::active"
,
self
.
on_search_toggle_button_clicked
)
self
.
search_
bar
.
connect_entry
(
self
.
search_entry
)
self
.
search_entry
.
connect
(
"search-changed"
,
self
.
on_search_changed
)
self
.
search_entry
.
connect
(
"search-changed"
,
self
.
on_search_changed
)
self
.
search_dropdown
.
connect
(
"notify::selected"
,
self
.
on_filter_changed
)
self
.
search_dropdown
.
connect
(
"notify::selected"
,
self
.
on_filter_changed
)
...
@@ -114,10 +115,6 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
...
@@ -114,10 +115,6 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
update_ui
()
self
.
update_ui
()
def
on_search_toggle_button_clicked
(
self
,
obj
,
_pspec
):
if
not
self
.
search_toggle_button
.
props
.
active
:
self
.
search_entry
.
props
.
text
=
""
def
on_is_loading_changed
(
self
,
obj
,
_pspec
):
def
on_is_loading_changed
(
self
,
obj
,
_pspec
):
self
.
main_stack
.
props
.
visible_child_name
=
"loading"
if
self
.
props
.
is_loading
else
"main"
self
.
main_stack
.
props
.
visible_child_name
=
"loading"
if
self
.
props
.
is_loading
else
"main"
...
...
src/window.ui
View file @
addbc84e
...
@@ -50,17 +50,20 @@
...
@@ -50,17 +50,20 @@
<property
name=
"child"
>
<property
name=
"child"
>
<object
class=
"AdwToolbarView"
>
<object
class=
"AdwToolbarView"
>
<property
name=
"content"
>
<property
name=
"content"
>
<object
class=
"
AdwToolbarView
"
>
<object
class=
"
GtkBox"
id=
"main_box
"
>
<property
name=
"
reveal-top-bars"
bind-source=
"search_toggle_button"
bind-property=
"active"
bind-flags=
"sync-create"
/
>
<property
name=
"
orientation"
>
vertical
</property
>
<child
type=
"top"
>
<child>
<object
class=
"AdwClamp"
>
<object
class=
"AdwClamp"
>
<property
name=
"margin-bottom"
>
4
</property>
<property
name=
"margin-end"
>
12
</property>
<property
name=
"margin-start"
>
12
</property>
<property
name=
"margin-top"
>
4
</property>
<property
name=
"maximum-size"
>
420
</property>
<property
name=
"maximum-size"
>
420
</property>
<child>
<child>
<object
class=
"GtkSearchBar"
id=
"search_bar"
>
<property
name=
"search-mode-enabled"
bind-source=
"search_toggle_button"
bind-property=
"active"
bind-flags=
"sync-create|bidirectional"
/>
<property
name=
"key-capture-widget"
>
main_box
</property>
<child>
<object
class=
"GtkBox"
>
<object
class=
"GtkBox"
>
<style>
<class
name=
"linked"
/>
</style>
<child>
<child>
<object
class=
"GtkSearchEntry"
id=
"search_entry"
>
<object
class=
"GtkSearchEntry"
id=
"search_entry"
>
<property
name=
"hexpand"
>
true
</property>
<property
name=
"hexpand"
>
true
</property>
...
@@ -81,14 +84,36 @@
...
@@ -81,14 +84,36 @@
<property
name=
"halign"
>
end
</property>
<property
name=
"halign"
>
end
</property>
</object>
</object>
</child>
</child>
</object>
</child>
</object>
<!-- <object class="GtkBox">
<child>
</child>
<child>
<object class="GtkDropDown" id="search_dropdown">
<property name="model">
<object class="GtkStringList">
<items>
<item translatable="yes">All</item>
<item translatable="yes">Installed</item>
<item translatable="yes">Uninstalled</item>
<item translatable="yes">Changed</item>
</items>
</object>
</property>
<property name="halign">end</property>
</object>
</child>
<style>
<style>
<class name="linked"/>
<class name="linked"/>
</style>
</style>
</object>
</object>
-->
</child>
</child>
</object>
</object>
</child>
</child>
<
property
name=
"content"
>
<
child
>
<object
class=
"GtkScrolledWindow"
>
<object
class=
"GtkScrolledWindow"
>
<property
name=
"propagate-natural-height"
>
true
</property>
<property
name=
"propagate-natural-height"
>
true
</property>
<property
name=
"hscrollbar-policy"
>
never
</property>
<property
name=
"hscrollbar-policy"
>
never
</property>
...
@@ -109,7 +134,7 @@
...
@@ -109,7 +134,7 @@
</object>
</object>
</child>
</child>
</object>
</object>
</
property
>
</
child
>
</object>
</object>
</property>
</property>
<child
type=
"bottom"
>
<child
type=
"bottom"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment