Skip to content

Commit

Permalink
Add symbol filter to outline pane (#1253)
Browse files Browse the repository at this point in the history
* Search symbol pane, first attempt

* Implement filter tool in symbol pane

* Extend range of symbol types, classify symbols

* Throttle refilter; refilter on check toggled

* Simplify filter; expand_all after filter

* Handle Namespace type; Add ActionBar

* Fix regression in search entry filtering

* Delete debug warning

* Inline namespace

* Space out filters, add header

* Reduce nesting in schedule refilter

* Simplify and flatten filter func

* Change stray Granite.Widget to Code.Widget

* Change another stray Granite.Widgets.SourceList

* Add filter icon, fix styles

* Jeremypw/use simple menu (#1459)

* Use GMenu and SimpleActions

* Single select action with parameter

* Fix lint

---------

Co-authored-by: Jeremy Wootten <[email protected]>
Co-authored-by: Ryan Kornheisl <[email protected]>
Co-authored-by: Danielle Foré <[email protected]>
  • Loading branch information
4 people authored Aug 2, 2024
1 parent 2952acc commit 28a063c
Show file tree
Hide file tree
Showing 9 changed files with 648 additions and 18 deletions.
8 changes: 8 additions & 0 deletions data/Application.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ textview.scrubber {
.fuzzy-item.preselect-fuzzy label {
opacity: 0.7;
}

.symbol-outline > box.horizontal {
margin: 1em;
}

.symbol-outline .sidebar {
background: inherit;
}
282 changes: 282 additions & 0 deletions data/icons/filter-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions data/io.elementary.code.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<file alias="scalable/actions/panel-right-rtl-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/panel-right-rtl-symbolic.svg</file>
<file alias="scalable/actions/panel-right-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/panel-right-symbolic.svg</file>
</gresource>
<gresource prefix="/io/elementary/code/icons">
<file alias="scalable/actions/filter-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/filter-symbolic.svg</file>
</gresource>
</gresources>
19 changes: 17 additions & 2 deletions src/SymbolPane/C/CtagsSymbol.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,25 @@

public class Scratch.Services.CtagsSymbol : Code.Widgets.SourceList.ExpandableItem {
public Scratch.Services.Document doc { get; construct set; }
public SymbolType symbol_type { get; set; default = SymbolType.OTHER; }
public int line { get; construct set; }

public CtagsSymbol (Scratch.Services.Document doc, string name, int line, Icon? _icon) {
Object (doc: doc, name: name, line: line);
public CtagsSymbol (
Scratch.Services.Document doc,
string name,
int line,
Icon? _icon,
SymbolType? s_type = null) {

Object (
doc: doc,
name: name,
line: line
);

icon = _icon;
if (s_type != null) {
symbol_type = s_type;
}
}
}
18 changes: 16 additions & 2 deletions src/SymbolPane/C/CtagsSymbolIter.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ public class Scratch.Services.CtagsSymbolIter : Object {
public string parent { get; construct set; }
public int line { get; construct set; }
public Icon? icon { get; construct set; }
public SymbolType? symbol_type;

public CtagsSymbolIter (string name, string parent, int line, Icon? icon) {
Object (name: name, parent: parent, line: line, icon: icon);
public CtagsSymbolIter (
string name,
string parent,
int line,
Icon? icon,
SymbolType? s_type = SymbolType.OTHER) {

Object (
name: name,
parent: parent,
line: line,
icon: icon
);

symbol_type = s_type;
}
}
Loading

0 comments on commit 28a063c

Please sign in to comment.