示例#1
0
        private static void ShowWindow(bool supportToggle)
        {
            if(taskWindow != null) {
                if(taskWindow.IsActive && supportToggle) {
                    int x;
                    int y;

                    taskWindow.GetPosition(out x, out y);

                    lastXPos = x;
                    lastYPos = y;

                    taskWindow.Hide();
                } else {
                    if(!taskWindow.Visible) {
                        int x = lastXPos;
                        int y = lastYPos;

                        if (x >= 0 && y >= 0)
                            taskWindow.Move(x, y);
                    }
                    taskWindow.Present();
                }
            } else if (GtkApplication.Instance.Backend != null) {
                TaskWindow.taskWindow = new TaskWindow(GtkApplication.Instance.Backend);
                if(lastXPos == 0 || lastYPos == 0)
                {
                    lastXPos = GtkApplication.Instance.Preferences.GetInt("MainWindowLastXPos");
                    lastYPos = GtkApplication.Instance.Preferences.GetInt("MainWindowLastYPos");
                }

                int x = lastXPos;
                int y = lastYPos;

                if (x >= 0 && y >= 0)
                    taskWindow.Move(x, y);

                taskWindow.ShowAll();
            }
        }