-
Notifications
You must be signed in to change notification settings - Fork 39
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
Maui.Core Gtk enhancements #5
Maui.Core Gtk enhancements #5
Conversation
…on, MauiGtkMainWindow
…eckBoxHandler, EditorHandler, EntryHandler, LabelHandler
} | ||
|
||
// this is maybe not needed: | ||
void UpdateFocusChain() |
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.
We will need it but probably at ViewHandler level.
|
||
protected void OnWindowAdded(object o, WindowAddedArgs args) | ||
{ | ||
; |
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.
We will need this events to have notifications at cross platform Window level, but for now, we can remove it or just include a comment.
public static class WidgetColorExtensions | ||
{ | ||
|
||
public static void SetBackgroundColor(this Gtk.Widget widget, Graphics.Color color) |
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.
.NET MAUI will have another object called Paint, that will give information about colors, gradients, etc. This extensions methods will be something like SetBackground(this Gtk.Widget widget, Graphics.Paint paint)
, but for now is fine.
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.
so this is related to have a Gtk specific Microsoft.Maui.Graphics implementation?
is it https://github.com/dotnet/Microsoft.Maui.Graphics/blob/02fe4e30a2ca482351e21fbb74cf44235a89c9e6/src/Microsoft.Maui.Graphics/Paint.cs?
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.
Exactly
public static Gdk.Color Dark(this Gtk.Style it, Gtk.StateType state) | ||
{ | ||
// TODO | ||
return it.Foreground(state); |
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.
When would it be used?
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.
removed, but i think i'll need it (or something similar) again to resolve OsAppTheme.Dark (https://github.com/lytico/maui/blob/622316ed64d88dca0da99d984abd155e7381f2af/src/Controls/src/Core/OSAppTheme.cs)
remark
some of WidgetColorExtensions are not used at this state of implementation
but i guess i'll need it later on
return it.Context.ColorFor("", state); | ||
} | ||
|
||
public static void ModifyBase(this Gtk.Widget it, Gtk.StateType state, Gdk.Color color) |
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.
When would it be used?
@@ -0,0 +1,42 @@ | |||
namespace Microsoft.Maui.Graphics.Native.Gtk |
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.
Will ask about this. We have different options:
- Create a Linux specific Microsoft.Maui.Graphics library here
- Push the Linux changes directly to the Microsoft.Maui.Graphics repo.
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.
please, your opinion to "Linux" versus "Gtk"; see: #6
second options would be better.
i'm planing to implement a Microsoft.Maui.Graphics Gtk NativeCanvas (if no others want to do 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.
Mnn, right, Gtk also can run on macOS and Windows so, must be Gtk instead of Linux.
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 any point in running Gtk on Windows or macOS, though, especially if we're talking within the context of Maui? Because Maui's Windows and macOS support is a first-class citizen, while Gtk's first-class citizen is Linux (I myself found many Gtk bugs in Windows and macOS; so many, that we should discourage its use).
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.
BTW guys you might want to get some inspiration from here (xamarin/Xamarin.Forms#14235) to implement Shapes API, a PR for XF that I just opened.
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.
@knocte thanks for the hint!
to get some inspiration from here (xamarin/Xamarin.Forms#14235)
but for implementing maui - shapes, i would propose to have pure maui-renderers using https://github.com/dotnet/Microsoft.Maui.Graphics/blob/main/src/Microsoft.Maui.Graphics/ICanvas.cs for all platforms
is there any point in running Gtk on Windows or macOS
it could be a point having a Maui-platform KDE / Qt on linux, so changing "linux" -> "Gtk" makes sense anyway. None of the code is linux-specific by now, but Gtk-specific
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.
it could be a point having a Maui-platform KDE / Qt on linux,
It could, but QtSharp has been in alpha development for years (if not more than a decade) and no project uses it. It must be real hard to bind C++ from C#... So I would only rename 'linux' to 'gtk' when QtSharp+Maui really happens for real (which may be never).
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.
Could you rebase ini-linux to fix the conflicts?. Thanks!
@lytico Nice progress, thanks! |
yes, sorry, i've started before your commits. but what MauiWindow is for? startup is done in anyway, the whole maui startup pattern seems unclear at the moment. should't it be something like
} |
@lytico I was initialising the HostBuilder etc in the main Window. Can remove it for now and continue with the implementation at Application level. |
sorry, can't rebase (don't understand why). git refuses to pull the rebased branch |
Maui.Core Gtk enhancements
Additions made
Handler-Enhancements
Prototype