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
Port to GtkSharp 3 all the Gtk# 2 dock system #148
Conversation
Thanks for working on this! I'll look through it later this weekend and give it a test |
I have some improvement I've done for Windows style if needed |
I'd be interested to see the changes! Most likely it would be safest to stick with the default GTK style / behaviors where possible though |
All colours are taken from GTK+ 3 theme. The icon are drawn, but we can mix up both code if native decorations are preferred. |
It also fixes some bugs, but there is still some features that could be miss-implemented. The tool stays mostly usable tho. |
If I don't answer, and if you prefer the old version, you can revert the last commit. |
Gave it a test on my Mac and it's working pretty well!
|
Just an update: I am actually porting the docking library of master Pinta branch. Should not take too long; almost everything works great except appearance. |
OK, sounds good! |
Done ! Can you try on macOS everything ? (don't own any mac) |
After more search for issues, I found 2 issues/differences with Gtk#2:
|
Another big issues:
|
All known issues are now fixed. |
Great, I'll have a look soon! |
The screenshots look very good! In the third screenshot, is the black text on black background for "Unsaved image 1" something that can be fixed, or is it a problem with the theme? |
I don't know why, I try to get "text_color" property. The only fix I see is to change this text by a Label. But it works with most themes. I tested with Yaru (ubuntu theme), its dark varient and it works too. I also tested with Gtk's win32 theme (on Windows), and if there will be Windows distribution, there should be a theme with it because everything is ugly on Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all this work!
I've left a few questions and suggestions in the comments
From testing on macOS (see screenshot below) the only issues I noticed were the missing icons (black squares beside the dock pad titles) and the inactive tab being drawn in black
I think the icon issue is from the changes to use themed icons in the GTK3 branch - my comment in HistoryPad.cs has a fix that should probably work
using System.Windows.Input; | ||
#endif | ||
|
||
namespace Hexadock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for this Hexadock
namespace rather than e.g. Pinta.Docking
? I'm not clear what its origin is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This come from one of my side projects, since when I ported Gtk#2 Docking, it was first for my side project named Hexacode. Will rename it
|
||
// Hide menuitem | ||
if ((Behavior & DockItemBehavior.CantClose) == 0) { | ||
MenuItem mitem = new MenuItem (("Hide")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this were translatable strings in the master
branch? (using Catalog.GetString()
). In the GTK3 build you can use Pinta.Core.Translations, but we could move that elsewhere if needed for Pinta.Docking to depend on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I referenced now Pinta.Core (for peaople that would want to use Pinta.Docking, it will not be so hard to remove it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good!
btnDock = new ImageButton (); | ||
btnDock.Image = pixAutoHide; | ||
btnDock.InactiveImage = pixAutoHide.WithAlpha (.5); | ||
btnDock.TooltipText = ("Auto Hide"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tooltips here should also be translatable.
@@ -0,0 +1,2 @@ | |||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file should be removed?
Pinta.Docking/Pinta.Docking.csproj
Outdated
|
||
<!-- References --> | ||
<ItemGroup> | ||
<Reference Condition=" '$(PINTA_MONO_POSIX_2)' != '' " Include="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might have been copied over from the master branch, but isn't necessary for GTK3
Could you revert some of this file to match the current gtk3-v2 branch? e.g. adding back the
<Version>1.8.0.0</Version>
<Authors>PintaProject</Authors>
<Company />
<Product />
Pinta/Pads/HistoryPad.cs
Outdated
|
||
// TODO-GTK3 (docking) | ||
#if false | ||
history_item.Label = ("History"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This string should be translatable (Translations.GetString()
)
Pinta/Pads/HistoryPad.cs
Outdated
history_item.Icon = Gtk.IconTheme.Default.LoadIcon(Resources.Icons.LayerDuplicate, 16); | ||
history_item.DefaultWidth = 100; | ||
history_item.Content = history; | ||
history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the GTK3 build we now use themed icons, so I think this should be Gtk.IconTheme.Default.LoadIcon(Resources.Icons.LayerDuplicate, 16);
from the deleted line above?
Pinta/Pads/LayersPad.cs
Outdated
layers_item.DefaultWidth = 100; | ||
layers_item.Label = ("Layers"); | ||
layers_item.Content = layers; | ||
layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar issues with label and icon as the other dock pads.
Pinta/Pads/OpenImagesPad.cs
Outdated
open_images_item.DefaultLocation = "Layers/Bottom"; | ||
open_images_item.Label = ("Images"); | ||
open_images_item.Content = new OpenImagesListWidget (); | ||
open_images_item.Icon = PintaCore.Resources.GetIcon ("Menu.Effects.Default.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar issues with label and icon as the other dock pads.
Pinta/Pads/ToolBoxPad.cs
Outdated
toolbox_item.Content = toolbox; | ||
toolbox_item.Icon = Gtk.IconTheme.Default.LoadIcon(Resources.Icons.ToolPencil, 16); | ||
toolbox_item.Icon = PintaCore.Resources.GetIcon ("Tools.Pencil.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar issues with label and icon as the other dock pads.
This looks very promising. Anything still blocking this from being merged? |
Yes, it is still ugly on macOS, I had a working branch but I lost it with a disk corruption. |
@Dadoum Sad to hear that! Hopefully you can still remember the important twists such that you can quickly redo your work. Looking forward to your changes! |
Going to rearchitect DockNotebook to make it use native components. This is the preferred approach in gtk 4 |
Just need some details about how it should be reimplemented. Now, the gtk3-v2 branch uses panels for 2 elements only (history and layers) and the notebook. It is maybe overkill to use it just for two panels ? Or should I recreate panels ? This would be a big rollback. |
I'd say try keeping the UI as-is with the latest version (so history / layers panel plus the notebook) and see how things look! |
No description provided.