Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Platform.Maui.Linux.Gtk4/Handlers/ListViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Gtk.Widget BuildTextCellWidget(TextCell cell, int index)
{
var c = cell.TextColor;
var css = Gtk.CssProvider.New();
css.LoadFromString($"label {{ color: rgba({(int)(c.Red*255)},{(int)(c.Green*255)},{(int)(c.Blue*255)},{c.Alpha}); }}");
css.LoadFromString($"label {{ color: {ToGtkColor(c)}; }}");
textLabel.GetStyleContext().AddProvider(css, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
row.Append(textLabel);
Expand All @@ -283,7 +283,7 @@ Gtk.Widget BuildTextCellWidget(TextCell cell, int index)
detailLabel.SetHalign(Gtk.Align.Start);
var detailCss = Gtk.CssProvider.New();
var dc = cell.DetailColor ?? Colors.Gray;
detailCss.LoadFromString($"label {{ font-size: 12px; color: rgba({(int)(dc.Red*255)},{(int)(dc.Green*255)},{(int)(dc.Blue*255)},{dc.Alpha}); }}");
detailCss.LoadFromString($"label {{ font-size: 12px; color: {ToGtkColor(dc)}; }}");
detailLabel.GetStyleContext().AddProvider(detailCss, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);
row.Append(detailLabel);
}
Expand Down Expand Up @@ -351,7 +351,7 @@ Gtk.Widget RenderViewAsNative(View mauiView)
{
var c = label.TextColor;
var css = Gtk.CssProvider.New();
css.LoadFromString($"label {{ color: rgba({(int)(c.Red*255)},{(int)(c.Green*255)},{(int)(c.Blue*255)},{c.Alpha}); }}");
css.LoadFromString($"label {{ color: {ToGtkColor(c)}; }}");
gtkLabel.GetStyleContext().AddProvider(css, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
if (label.FontAttributes.HasFlag(FontAttributes.Bold))
Expand Down
2 changes: 1 addition & 1 deletion src/Platform.Maui.Linux.Gtk4/Handlers/SwipeViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static void BuildSideActions(Gtk.Box? container, SwipeItems? items, SwipeViewHan
var bg = item.BackgroundColor ?? Colors.LightGray;
var cssProvider = Gtk.CssProvider.New();
cssProvider.LoadFromString(
$"button {{ background-image: none; background-color: rgba({(int)(bg.Red*255)},{(int)(bg.Green*255)},{(int)(bg.Blue*255)},{bg.Alpha}); color: white; border-radius: 0; border: none; }}");
$"button {{ background-image: none; background-color: {ToGtkColor(bg)}; color: white; border-radius: 0; border: none; }}");
btn.GetStyleContext().AddProvider(cssProvider, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);

var capturedItem = item;
Expand Down
6 changes: 3 additions & 3 deletions src/Platform.Maui.Linux.Gtk4/Handlers/TableViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Gtk.Widget BuildTextCell(TextCell cell)
{
var c = cell.TextColor;
var css = Gtk.CssProvider.New();
css.LoadFromString($"label {{ color: rgba({(int)(c.Red*255)},{(int)(c.Green*255)},{(int)(c.Blue*255)},{c.Alpha}); }}");
css.LoadFromString($"label {{ color: {ToGtkColor(c)}; }}");
textLabel.GetStyleContext().AddProvider(css, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
box.Append(textLabel);
Expand All @@ -143,7 +143,7 @@ Gtk.Widget BuildTextCell(TextCell cell)
detailLabel.SetHalign(Gtk.Align.Start);
var dc = cell.DetailColor ?? Colors.Gray;
var css = Gtk.CssProvider.New();
css.LoadFromString($"label {{ font-size: 12px; color: rgba({(int)(dc.Red*255)},{(int)(dc.Green*255)},{(int)(dc.Blue*255)},{dc.Alpha}); }}");
css.LoadFromString($"label {{ font-size: 12px; color: {ToGtkColor(dc)}; }}");
detailLabel.GetStyleContext().AddProvider(css, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);
box.Append(detailLabel);
}
Expand Down Expand Up @@ -252,7 +252,7 @@ Gtk.Widget RenderViewAsNative(View mauiView)
{
var c = label.TextColor;
var css = Gtk.CssProvider.New();
css.LoadFromString($"label {{ color: rgba({(int)(c.Red*255)},{(int)(c.Green*255)},{(int)(c.Blue*255)},{c.Alpha}); }}");
css.LoadFromString($"label {{ color: {ToGtkColor(c)}; }}");
gtkLabel.GetStyleContext().AddProvider(css, Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
if (label.FontAttributes.HasFlag(FontAttributes.Bold))
Expand Down