Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented May 22, 2021

Fixes #1033

  • Move outline code into main code and remove the plugin
  • Show outline to the right of the document with matching background
  • Add preference option to show outline
  • Add action to toggle outline visiblity (<Alt>\)
  • RemoveDocument signal (doc_saved ()) that was only used by the plugin

@jeremypw jeremypw mentioned this pull request May 31, 2021
@jeremypw jeremypw marked this pull request as ready for review July 18, 2021 18:05
@jeremypw jeremypw requested a review from a team July 18, 2021 18:05
@jeremypw
Copy link
Collaborator Author

SymbolsOnRight

@jeremypw
Copy link
Collaborator Author

@danrabbit I would appreciate your advice as to how to get the symbol list (which is a Granite.Widgets.SourceList) to follow the styling of the document wrt background and text color.

@cassidyjames
Copy link
Contributor

cassidyjames commented Jan 6, 2022

@jeremypw it is probably worth looking at and adapting this method, as setting the background to @tab_base_color seems to get us most of the way there:

private void update_inline_tab_colors () {
var sssm = Gtk.SourceStyleSchemeManager.get_default ();
var style_scheme = Scratch.settings.get_string ("style-scheme");
if (style_scheme in sssm.scheme_ids) {
var theme = sssm.get_scheme (style_scheme);
var text_color_data = theme.get_style ("text");
// Default gtksourceview background color is white
var color = "#FFFFFF";
if (text_color_data != null) {
// If the current style has a background color, use that
color = text_color_data.background;
}
var define = "@define-color tab_base_color %s;".printf (color);
try {
style_provider.load_from_data (define);
} catch (Error e) {
critical ("Unable to set inline tab styling, going back to classic notebook tabs");
}
}
}

Screenshot from 2022-01-06 11-55-23 Screenshot from 2022-01-06 11-55-19 Screenshot from 2022-01-06 11-55-14

Perhaps renaming that method and defining a GTK CSS variable called @themed_bg or something could work, then we could use that in the various places we want to use that color?

@jeremypw
Copy link
Collaborator Author

jeremypw commented Jan 7, 2022

@cassidyjames Thanks for the suggestion! I'll try that.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Jan 8, 2022

@cassidyjames Implemented your suggestion - thanks.

@danirabbit
Copy link
Member

If we're moving this anyways, can we make it not be a plugin and just have it be part of the app?

I wonder if we should also add a menuitem to toggle its visibility like we have with the sidebar

@jeremypw
Copy link
Collaborator Author

Yes, it should not be too hard to move the code into a "SymbolOutline" subfolder of \src and bypass the plugin interface. As you say, an alternative way of toggling it will be needed.

@jeremypw
Copy link
Collaborator Author

The latest commit moves the outline code to the /src. Note that you should run it as a flatpak as it is not compatible with the existing plugin code. Otherwise you will need to delete the outline plugin from /usr/lib/x86_64-linux-gnu/io.elementary.files/plugins.

Should I include code to blacklist/overwrite the outline plugin in the same way as I did in #1151?

@jeremypw
Copy link
Collaborator Author

I have taken the opportunity to DRY the code to reduce duplication between the Vala and C outliners.

@jeremypw jeremypw marked this pull request as draft January 14, 2022 19:04
@jeremypw
Copy link
Collaborator Author

Need to fix some regressions.

@jeremypw jeremypw marked this pull request as ready for review January 15, 2022 18:14
@jeremypw
Copy link
Collaborator Author

I have added code to overwrite the old plugin when not installed as Flatpak in order to make development and testing easier. This can easily be reverted if considered unnecessary.

Jeremy Wootten added 3 commits April 6, 2022 18:33
# Conflicts fixed:
#	data/io.elementary.code.appdata.xml.in
#	plugins/outline/meson.build
#	src/Services/Document.vala
#	src/Widgets/DocumentView.vala
#	src/Widgets/HeaderBar.vala
@jeremypw
Copy link
Collaborator Author

Removed "blacklist" code as it was not needed when the strip-trailing-spaces plugin was moved into main code.

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a completely commented file: src/SymbolPane/meson.build

Otherwise, works as expected and looks good!

@jeremypw jeremypw requested a review from danirabbit October 25, 2022 08:38
@danirabbit danirabbit merged commit 9cf6b74 into master Oct 26, 2022
@danirabbit danirabbit deleted the symbolpane-on-right branch October 26, 2022 16:51
davidmhewitt added a commit that referenced this pull request Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the outline to the right allowing it to be document-dependant

4 participants