示例#1
0
 public MenuPlugin(TPanel panel, PluginConfig cfg)
     : base(panel, cfg)
 {
     button = new ToggleButton();
     button.Add(new Label("Menu"));
     button.Clicked += (s, e) => {
         if (button.Active)
         {
             Open();
         }
         else
         {
             Close();
         }
     };
 }
示例#2
0
        public ClockPlugin(TPanel panel, PluginConfig cfg)
            : base(panel, cfg)
        {
            button = new ToggleButton();
            button.Add(new Label("DateTime"));

            /*			button.Clicked += (s, e) => {
             *      if (button.Active)
             *              Open();
             *      else
             *              Close();
             * };*/


            button.Clicked += (s, e) => {
                CoreLib.Signal("test");
            };
        }
示例#3
0
        public static void Main(string[] args)
        {
            Application.Init();



            //var dwin = new DesktopWindow();
            //dwin.Show();

            /*GLib.ExceptionManager.UnhandledException += (e) => {
             *      e.ExitApplication = false;
             *      CoreLib.Log(e.ExceptionObject.ToString());
             * };*/

            try {
                var logwin = new LogWindow();
                logwin.Show();
                CoreLib.Log("log started");


                AppConfig.Load("../config/config.xml");

                //Gtk.Settings.Default.ThemeName = "Dorian-3.16";
                var shellMan = ShellManager.Create();
                shellMan.UpdateWindows();

                var idx = new TLauncherIndex();
                idx.AddLocations();
                idx.Rebuild();

                foreach (var panConfig in AppConfig.Panels)
                {
                    var pwin = new TPanel(panConfig);
                    pwin.Setup();
                    pwin.Show();
                }
            } catch (Exception ex) {
                CoreLib.MessageBox(ex.ToString());
            }

            Application.Run();
        }
示例#4
0
        public WindowListPlugin(TPanel panel, PluginConfig cfg)
            : base(panel, cfg)
        {
            buttonTable = new PanelButtonTable(Orientation.Horizontal);
            //box.HeightRequest = panel.height;
            Update();

            ShellManager.Current.WindowActivated += (wnd) => {
                var bt = GetButton(wnd);
                if (bt != null)
                {
                    CoreLib.Log("act");
                    Application.Invoke((s, e) => {
                        foreach (var b in buthash2.Values)
                        {
                            b.Active = bt == b;
                        }
                    });
                    //bt.Toggle();
                }
            };
            ShellManager.Current.WindowDestroyed += (wnd) => {
                var bt = GetButton(wnd);
                if (bt != null)
                {
                    buthash2.Remove(wnd);
                    buttonTable.Remove(bt);
                    bt.Dispose();
                }
            };
            ShellManager.Current.WindowCreated += (wnd) => {
                if (wnd.ShowInTaskbar())
                {
                    createButton(wnd);
                }
            };
        }
示例#5
0
        public static TPlugin CreateIntance(TPanel panel, PluginConfig cfg)
        {
            var t = GetPluginType(cfg.Type);

            return((TPlugin)Activator.CreateInstance(t, new object[] { panel, cfg }));
        }
示例#6
0
 public TPlugin(TPanel panel, PluginConfig cfg)
 {
     this.panel  = panel;
     this.cfg    = cfg;
     this.expand = cfg.Expand;
 }