Commit 9e61e6a91230d75ab6c77d270c62fa5c6f6930f0
- Diff rendering mode:
- inline
- side by side
src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
(1 / 1)
|   | |||
| 67 | 67 | ||
| 68 | 68 | base.OnStyleSet (old_style); | |
| 69 | 69 | RecomputeRowHeight = true; | |
| 70 | theme = new GtkTheme (this); | ||
| 70 | theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (this); | ||
| 71 | 71 | ||
| 72 | 72 | // Save the drawable so we can reuse it | |
| 73 | 73 | Gdk.Drawable drawable = cell_context != null ? cell_context.Drawable : null; |
src/Libraries/Hyena.Gui/Hyena.Gui.Theming/ThemeEngine.cs
(67 / 0)
|   | |||
| 1 | // | ||
| 2 | // ThemeEngine.cs | ||
| 3 | // | ||
| 4 | // Author: | ||
| 5 | // Aaron Bockover <abockover@novell.com> | ||
| 6 | // | ||
| 7 | // Copyright 2009 Aaron Bockover | ||
| 8 | // | ||
| 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 10 | // of this software and associated documentation files (the "Software"), to deal | ||
| 11 | // in the Software without restriction, including without limitation the rights | ||
| 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 13 | // copies of the Software, and to permit persons to whom the Software is | ||
| 14 | // furnished to do so, subject to the following conditions: | ||
| 15 | // | ||
| 16 | // The above copyright notice and this permission notice shall be included in | ||
| 17 | // all copies or substantial portions of the Software. | ||
| 18 | // | ||
| 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 25 | // THE SOFTWARE. | ||
| 26 | |||
| 27 | using System; | ||
| 28 | |||
| 29 | namespace Hyena.Gui.Theming | ||
| 30 | { | ||
| 31 | internal class SuperHackThemeEngineProviderArgs : EventArgs | ||
| 32 | { | ||
| 33 | private Gtk.Widget widget; | ||
| 34 | public Gtk.Widget Widget { | ||
| 35 | get { return widget; } | ||
| 36 | set { widget = value; } | ||
| 37 | } | ||
| 38 | |||
| 39 | private Theme theme; | ||
| 40 | public Theme Theme { | ||
| 41 | set { theme = value; } | ||
| 42 | get { return theme; } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | public static class ThemeEngine | ||
| 47 | { | ||
| 48 | private static EventHandler provider; | ||
| 49 | |||
| 50 | public static void SetProvider (EventHandler provider) | ||
| 51 | { | ||
| 52 | ThemeEngine.provider = provider; | ||
| 53 | } | ||
| 54 | |||
| 55 | public static Theme CreateTheme (Gtk.Widget widget) | ||
| 56 | { | ||
| 57 | if (provider == null) { | ||
| 58 | return new GtkTheme (widget); | ||
| 59 | } | ||
| 60 | |||
| 61 | SuperHackThemeEngineProviderArgs args = new SuperHackThemeEngineProviderArgs (); | ||
| 62 | args.Widget = widget; | ||
| 63 | provider (null, args); | ||
| 64 | return args.Theme ?? new GtkTheme (widget); | ||
| 65 | } | ||
| 66 | } | ||
| 67 | } |
src/Libraries/Hyena.Gui/Hyena.Gui.csproj
(2 / 2)
|   | |||
| 29 | 29 | <Reference Include="System" /> | |
| 30 | 30 | <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | |
| 31 | 31 | <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | |
| 32 | <Reference Include="Mono.Cairo, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> | ||
| 32 | <Reference Include="Mono.Cairo" /> | ||
| 33 | 33 | <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | |
| 34 | 34 | <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | |
| 35 | 35 | <Reference Include="System.Xml" /> | |
| … | … | ||
| 127 | 127 | <Compile Include="Hyena.Gui.Theatrics\Pulsator.cs" /> | |
| 128 | 128 | <Compile Include="Hyena.Gui\PixbufImageSurface.cs" /> | |
| 129 | 129 | <Compile Include="Hyena.Widgets\TextViewEditable.cs" /> | |
| 130 | <Compile Include="Hyena.Gui.Theming\ThemeEngine.cs" /> | ||
| 130 | 131 | </ItemGroup> | |
| 131 | 132 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | |
| 132 | 133 | <ProjectExtensions> | |
| 133 | 134 | <MonoDevelop> | |
| 134 | 135 | <Properties> | |
| 135 | 136 | <Deployment.LinuxDeployData generateScript="false" /> | |
| 136 | <GtkDesignInfo /> | ||
| 137 | 137 | <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile.am"> | |
| 138 | 138 | <BuildFilesVar Sync="true" Name="SOURCES" /> | |
| 139 | 139 | <DeployFilesVar /> |
src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs
(1 / 1)
|   | |||
| 111 | 111 | protected override void OnRealized () | |
| 112 | 112 | { | |
| 113 | 113 | base.OnRealized (); | |
| 114 | theme = new GtkTheme (this); | ||
| 114 | theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (this); | ||
| 115 | 115 | } | |
| 116 | 116 | ||
| 117 | 117 | protected override void OnSizeAllocated (Gdk.Rectangle allocation) |
src/Libraries/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs
(1 / 1)
|   | |||
| 92 | 92 | protected override void OnRealized () | |
| 93 | 93 | { | |
| 94 | 94 | base.OnRealized (); | |
| 95 | theme = new GtkTheme (this); | ||
| 95 | theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (this); | ||
| 96 | 96 | } | |
| 97 | 97 | ||
| 98 | 98 | protected override void OnSizeRequested (ref Requisition requisition) |
src/Libraries/Hyena.Gui/Makefile.am
(1 / 0)
|   | |||
| 40 | 40 | Hyena.Gui.Theming/GtkTheme.cs \ | |
| 41 | 41 | Hyena.Gui.Theming/Theme.cs \ | |
| 42 | 42 | Hyena.Gui.Theming/ThemeContext.cs \ | |
| 43 | Hyena.Gui.Theming/ThemeEngine.cs \ | ||
| 43 | 44 | Hyena.Gui/CairoExtensions.cs \ | |
| 44 | 45 | Hyena.Gui/CleanRoomStartup.cs \ | |
| 45 | 46 | Hyena.Gui/CompositeUtils.cs \ |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

