Skip to content

Commit

Permalink
Removed unnecessary Gtk generics
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Nov 6, 2024
1 parent a25b49c commit 342a58a
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions packages/lib/src/generics/gtk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,8 @@ export default {
constraint: GObject.getType()
});

// Add generic support for FlowBox
FlowBox.addGeneric({
default: GObject.getType(),
constraint: GObject.getType()
});

// Add generic support for ListBox
ListBox.addGeneric({
default: GObject.getType(),
constraint: GObject.getType()
});

// Update bind_model methods to use generics
const updateBindModel = (cls: IntrospectedBaseClass, widgetFuncName: string) => {
const updateBindModelMethod = (cls: IntrospectedBaseClass, widgetFuncName: string) => {
cls.members = cls.members.map(m => {
if (m.name === "bind_model") {
m.generics.push(new Generic(new GenericType("A"), GObject.getType(), undefined, GObject.getType()));
Expand All @@ -71,7 +59,7 @@ export default {
});
};

updateBindModel(FlowBox, "FlowBoxCreateWidgetFunc");
updateBindModel(ListBox, "ListBoxCreateWidgetFunc");
updateBindModelMethod(FlowBox, "FlowBoxCreateWidgetFunc");
updateBindModelMethod(ListBox, "ListBoxCreateWidgetFunc");
}
};

0 comments on commit 342a58a

Please sign in to comment.