Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: filters #800

Merged
merged 9 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-rich-text-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-earth-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-verified-checkmark-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-funnel-symbolic.svg</file>
<!-- <file preprocess="xml-stripblanks">icons/scalable/actions/tuba-language-symbolic.svg</file> -->

<file>gtk/help-overlay.ui</file>
Expand Down Expand Up @@ -87,6 +88,7 @@
<file>ui/dialogs/main.ui</file>
<file>ui/dialogs/preferences.ui</file>
<file>ui/dialogs/profile_edit.ui</file>
<file>ui/dialogs/filter_edit.ui</file>
<file>ui/menus.ui</file>
</gresource>
</gresources>
2 changes: 2 additions & 0 deletions data/icons/scalable/actions/tuba-funnel-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions data/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -657,3 +657,8 @@ GtkSourceAssistant row:last-child {
.account-stats {
font-size: small;
}

.filter {
margin: -2px;
border-radius: 0;
}
117 changes: 117 additions & 0 deletions data/ui/dialogs/filter_edit.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0" />
<requires lib="libadwaita" version="1.0" />
<template class="TubaDialogsFilterEdit" parent="AdwWindow">
<property name="modal">1</property>
<property name="default_width">460</property>
<property name="default_height">520</property>
<property name="title" translatable="1">Edit Filter</property>
<child>
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar">
<property name="show-end-title-buttons">0</property>
<property name="show-start-title-buttons">0</property>
<child type="start">
<object class="GtkButton">
<property name="label" translatable="yes">Cancel</property>
<signal name="clicked" handler="on_close" swapped="no" />
</object>
</child>
<child type="end">
<object class="GtkButton" id="save_btn">
<property name="receives_default">1</property>
<property name="sensitive">0</property>
<property name="label" translatable="yes">Save</property>
<signal name="clicked" handler="on_save_clicked" swapped="no" />
<style>
<class name="suggested-action" />
</style>
</object>
</child>
</object>
</child>
<property name="content">
<object class="AdwToastOverlay" id="toast_overlay">
<property name="child">
<object class="GtkScrolledWindow">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="AdwClamp">
<property name="valign">start</property>
<property name="tightening-threshold">100</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<property name="spacing">24</property>
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="boxed-list" />
</style>
<child>
<object class="AdwEntryRow" id="title_row">
<property name="input-purpose">free-form</property>
<property name="title" translatable="yes">Title</property>
<signal name="changed" handler="on_title_row_changed" swapped="no" />
</object>
</child>
<child>
<object class="AdwComboRow" id="expire_in_row">
<property name="title" translatable="yes">Expires In</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="hide_row">
<property name="title" translatable="yes">Hide Completely</property>
<property name="subtitle" translatable="yes">Otherwise a warning will be used</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="context_group">
<property name="title" translatable="yes">Contexts</property>
<property name="description" translatable="yes">One or multiple contexts where the filter should apply</property>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="keywords_group">
<property name="title" translatable="yes">Keywords or Phrases</property>
<child type="header-suffix">
<object class="GtkButton">
<property name="valign">center</property>
<signal name="clicked" handler="add_keyword_row" swapped="no" />
<child>
<object class="AdwButtonContent">
<property name="icon-name">tuba-plus-large-symbolic</property>
<property name="label">Add Keyword</property>
</object>
</child>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
</object>
</child>
<style>
<class name="profile-editor" />
</style>
</template>
</interface>
29 changes: 28 additions & 1 deletion data/ui/dialogs/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,32 @@
</child>
</object>
</child>
<child>
<object class="AdwPreferencesPage" id="filters_page">
<property name="icon_name">tuba-funnel-symbolic</property>
<property name="title" translatable="yes">Filters</property>
<property name="visible">1</property>
<child>
<object class="AdwPreferencesGroup" id="keywords_group">
<property name="title" translatable="yes">Keywords</property>
<child type="header-suffix">
<object class="GtkButton">
<property name="valign">center</property>
<signal name="clicked" handler="add_keyword_row" swapped="no" />
<child>
<object class="AdwButtonContent">
<property name="icon-name">tuba-plus-large-symbolic</property>
<property name="label">Add Filter</property>
</object>
</child>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
</interface>
Loading
Loading