public UserInterface() { string gtk_version = string.Format("{0}.{1}.{2}", Global.MajorVersion, Global.MinorVersion, Global.MicroVersion); Logger.LogInfo("Environment", "GTK+ " + gtk_version); application = new Application("org.sparkleshare.SparkleShare", GLib.ApplicationFlags.None); application.Register(null); application.Activated += ApplicationActivatedDelegate; IconTheme.Default.AppendSearchPath(Path.Combine(UserInterface.AssetsPath, "icons")); var label = new Label(); Gdk.Color color = UserInterfaceHelpers.RGBAToColor(label.StyleContext.GetColor(StateFlags.Insensitive)); SecondaryTextColor = UserInterfaceHelpers.ColorToHex(color); var tree_view = new TreeView(); color = UserInterfaceHelpers.MixColors( UserInterfaceHelpers.RGBAToColor(tree_view.StyleContext.GetColor(StateFlags.Selected)), UserInterfaceHelpers.RGBAToColor(tree_view.StyleContext.GetBackgroundColor(StateFlags.Selected)), 0.39); SecondaryTextColorSelected = UserInterfaceHelpers.ColorToHex(color); }
void DetectTextColors() { Gdk.Color text_color = UserInterfaceHelpers.RGBAToColor(new Label().StyleContext.GetColor(StateFlags.Insensitive)); var tree_view_style = new TreeView().StyleContext; Gdk.Color text_color_selected = UserInterfaceHelpers.MixColors( UserInterfaceHelpers.RGBAToColor(tree_view_style.GetColor(StateFlags.Selected)), UserInterfaceHelpers.RGBAToColor(tree_view_style.GetBackgroundColor(StateFlags.Selected)), 0.2); SecondaryTextColor = UserInterfaceHelpers.ColorToHex(text_color); SecondaryTextColorSelected = UserInterfaceHelpers.ColorToHex(text_color_selected); }
public UserInterface() { application = new Application("org.sparkleshare.SparkleShare", GLib.ApplicationFlags.None); application.Register(null); application.Activated += ApplicationActivatedDelegate; Gdk.Color color = UserInterfaceHelpers.RGBAToColor(new Label().StyleContext.GetColor(StateFlags.Insensitive)); SecondaryTextColor = UserInterfaceHelpers.ColorToHex(color); var tree_view = new TreeView(); color = UserInterfaceHelpers.MixColors( UserInterfaceHelpers.RGBAToColor(tree_view.StyleContext.GetColor(StateFlags.Selected)), UserInterfaceHelpers.RGBAToColor(tree_view.StyleContext.GetBackgroundColor(StateFlags.Selected)), 0.39); SecondaryTextColorSelected = UserInterfaceHelpers.ColorToHex(color); }