예제 #1
0
        static void InitGlobalResourceFile()
        {
            String gtkResouceFile;

            Assembly myAssembly = Assembly.GetExecutingAssembly();

            string[] names = myAssembly.GetManifestResourceNames();
            foreach (string name in names)
            {
                Console.WriteLine(name);
                if (name.Contains("GtkThemeResource.rc"))
                {
                    gtkResouceFile = name;
                    break;
                }
                Console.WriteLine("Gtk Theme Resource not found in manifest");
            }

            var    tmpFile = Path.GetTempFileName();
            var    stream  = myAssembly.GetManifestResourceStream(gtkResouceFile);
            string gtkrc;

            using (StreamReader reader = new StreamReader(stream)) {
                gtkrc = reader.ReadToEnd();
            }
            using (StreamWriter outputFile = new StreamWriter(tmpFile)) {
                outputFile.WriteLine(gtkrc);
            }
            Rc.AddDefaultFile(tmpFile);
            Rc.Parse(tmpFile);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var theme = "ambiance_radiance_flat_blue.gtkrc";

            Application.Init();
            Rc.AddDefaultFile(theme);
            Rc.Parse(theme);
            var win = new MainWindow();

            win.Show();
            Application.Run();
        }
예제 #3
0
        public WindowsGtkStyle(string gtkrc_filename)
        {
            if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
                Environment.OSVersion.Platform == PlatformID.Win32S ||
                Environment.OSVersion.Platform == PlatformID.Win32Windows ||
                Environment.OSVersion.Platform == PlatformID.WinCE)
            {
                Rc.AddDefaultFile(gtkrc_filename);

                /*Microsoft.Win32.SystemEvents.DisplaySettingsChanged += delegate {
                 *      UpdateStyle();
                 * };*/
            }
        }
예제 #4
0
        static void InitGtk()
        {
            string gtkRC, iconsDir;

            gtkRC = Path.Combine(Config.dataDir, "theme", "gtk-2.0", "gtkrc");
            if (File.Exists(gtkRC))
            {
                Rc.AddDefaultFile(gtkRC);
            }

            Application.Init();

            iconsDir = Path.Combine(Config.dataDir, "icons");
            if (Directory.Exists(iconsDir))
            {
                IconTheme.Default.PrependSearchPath(iconsDir);
            }
        }
예제 #5
0
        static void InitGtk()
        {
            string gtkRC, iconsDir, styleConf;

            gtkRC = Path.Combine(Config.dataDir, "theme", "gtk-2.0", "gtkrc");
            if (File.Exists(gtkRC))
            {
                Rc.AddDefaultFile(gtkRC);
            }

            styleConf    = Path.Combine(Config.dataDir, "theme", "longomatch-dark.json");
            Config.Style = StyleConf.Load(styleConf);

            Application.Init();

            iconsDir = Path.Combine(Config.dataDir, "icons");
            if (Directory.Exists(iconsDir))
            {
                IconTheme.Default.PrependSearchPath(iconsDir);
            }
        }