From 4dc755be81bb8af03db77a8adead1e546a4d04f7 Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sun, 26 May 2024 07:52:29 -0400 Subject: [PATCH] player widget: use concrete type in structs --- Project.toml | 2 +- src/extrawidgets.jl | 7 ++----- src/player.ui | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index 3849f19..4c4fe57 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "GtkObservables" uuid = "8710efd8-4ad6-11eb-33ea-2d5ceb25a41c" -version = "2.1.0" +version = "2.1.1" [deps] Cairo = "159f3aea-2a34-519c-b102-8c37f9878175" diff --git a/src/extrawidgets.jl b/src/extrawidgets.jl index 8b774e1..3321f5d 100644 --- a/src/extrawidgets.jl +++ b/src/extrawidgets.jl @@ -31,7 +31,7 @@ struct PlayerWithTextbox range::UnitRange{Int} # valid values for index direction::Observable{Int8} # +1 = forward, -1 = backward, 0 = not playing # GUI elements - frame::GtkFrame + frame::GtkFrameLeaf scale::Slider{Int} entry::Textbox play_back::Button @@ -55,9 +55,6 @@ function PlayerWithTextbox(builder, index::Observable{Int}, range::UnitRange{Int step_forward = button(; widget=builder["step_forward$id"]::Gtk4.GtkButton) play_forward = button(; widget=builder["play_forward$id"]::Gtk4.GtkButton) - # Fix up widget properties - set_gtk_property!(scale.widget, "round-digits", 0) # glade/gtkbuilder bug that I have to set this here? - # Link the buttons clampindex(i) = clamp(i, minimum(range), maximum(range)) preserved = Any[on(play_back; weak=true) do _ direction[] = -1 end, @@ -130,7 +127,7 @@ Base.unsafe_convert(::Type{Ptr{Gtk4.GLib.GObject}}, p::PlayerWithTextbox) = struct TimeWidget{T <: Dates.TimeType} <: InputWidget{T} observable::Observable{T} - widget::GtkFrame + widget::GtkFrameLeaf end """ diff --git a/src/player.ui b/src/player.ui index c663e77..29fcee9 100644 --- a/src/player.ui +++ b/src/player.ui @@ -12,7 +12,7 @@ 1 - 6 + 0 @@ -68,7 +68,7 @@ 1 - 6 + 0