AndrewBelt / osdialog

A cross platform wrapper for OS dialogs like file save, open, message boxes, inputs, color picking, etc.
Creative Commons Zero v1.0 Universal
122 stars 19 forks source link

Fix gtk color selection #25

Closed ttytm closed 9 months ago

ttytm commented 9 months ago

Hey @AndrewBelt,

thanks a lot for the work on the lib!

I found it after having started working on a similar C lib. The plan was to bind to it from a different language. Now seeing that your project covers most of the planned functionalities and seems well written, I would like to just use and bind to your osdialog. It would be used an open source project and I would leave mentions to your lib in the repository. If there is some fix that can be made in the C code, I would submit it here as PR if that's not to annoying for you.

In this PR I'm submitting a fix for the gtk color chooser. gtk_color_selection_set_has_opacity_control is a gtk3 function that is currently used in the gtk2 else condition and has no effect. The function used in gtk3 condtion gtk_color_chooser_set_use_alpha is a gtk4 function, adding it apparently disables the gtk3 opacity slider. So opening the gtk3 dialog currently has no opacity slider. The change fixes this.

before: Screenshot_20231006_154006

after: Screenshot_20231006_153944

ttytm commented 9 months ago

I was running into the mentioned issues due to a type error that wasn't caught in the binding I'm working on. Things work fine as they are :+1: Sorry about then noice.