示例#1
0
        private void Build()
        {
            foreach (Gtk.Widget w in Children)
            {
                w.Destroy();
            }

            d_properties = null;
            d_function   = null;
            d_piecewise  = null;

            Object obj = new Object(d_wrapper, d_actions, d_network);

            obj.Show();

            obj.Error += delegate(object source, Exception exception) {
                Error(source, exception);
            };

            obj.TemplateActivated += delegate(object source, Wrappers.Wrapper template) {
                TemplateActivated(source, template);
            };

            Gtk.HBox top = new Gtk.HBox(false, 6);
            top.Show();

            top.PackStart(obj, true, true, 0);

            if (!(d_wrapper is Wrappers.Function))
            {
                d_properties = new Variables(d_wrapper, d_actions);
                d_properties.Show();

                d_properties.Error += delegate(object source, Exception exception) {
                    Error(source, exception);
                };
            }
            else if (d_wrapper is Wrappers.FunctionPolynomial)
            {
                d_piecewise = new PiecewisePolynomial(d_wrapper as Wrappers.FunctionPolynomial, d_actions);
                d_piecewise.Show();

                top.PackEnd(d_piecewise.PeriodWidget, false, false, 0);
            }
            else
            {
                d_function = new Function(d_wrapper as Wrappers.Function, d_actions);
                d_function.Show();

                d_function.Error += delegate(object source, Exception exception) {
                    Error(source, exception);
                };
            }

            PackStart(top, false, false, 0);

            Wrappers.Edge link = d_wrapper as Wrappers.Edge;
            Wrappers.Node node = d_wrapper as Wrappers.Node;

            if (node != null && node.HasSelfEdge)
            {
                link = node.SelfEdge;
            }

            if (link != null)
            {
                Gtk.HPaned paned = new Gtk.HPaned();
                paned.Show();

                paned.Pack1(d_properties, true, true);

                Edge actions = new Edge(link, d_actions);
                actions.Show();

                paned.Pack2(actions, true, true);

                PackStart(paned, true, true, 0);
            }
            else if (d_properties != null)
            {
                PackStart(d_properties, true, true, 0);
            }
            else if (d_function != null)
            {
                PackStart(d_function, true, true, 0);
            }
            else if (d_piecewise != null)
            {
                PackStart(d_piecewise, true, true, 0);
            }
        }
示例#2
0
文件: MainWindow.cs 项目: glwu/smuxi
        public MainWindow()
            : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null) {
                width  = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            } else {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null) {
                heigth = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            } else {
                heigth = 600;
            }
            if (width < -1 || heigth < -1) {
                width = -1;
                heigth = -1;
            }
            if (width == -1 && heigth == -1) {
                SetDefaultSize(800, 600);
                Maximize();
            } else if (width == 0 && heigth == 0) {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            } else {
                SetDefaultSize(width, heigth);
            }

            int x, y;
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null) {
                x = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            } else {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null) {
                y = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            } else {
                y = 0;
            }
            if (x < 0 || y < 0) {
                x = 0;
                y = 0;
            }
            if (x == 0 && y == 0) {
                SetPosition(Gtk.WindowPosition.Center);
            } else {
                Move(x, y);
            }

            DeleteEvent += OnDeleteEvent;
            FocusInEvent += OnFocusInEvent;
            FocusOutEvent += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            ChatTreeView = new ChatTreeView();

            Notebook = new Notebook();
            Notebook.SwitchPage += OnNotebookSwitchPage;
            Notebook.FocusInEvent += OnNotebookFocusInEvent;

            ChatViewManager = new ChatViewManager(Notebook, ChatTreeView);
            Assembly asm = Assembly.GetExecutingAssembly();
            ChatViewManager.Load(asm);
            ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                     "smuxi-frontend-gnome-*.dll");
            ChatViewManager.ChatAdded += OnChatViewManagerChatAdded;
            ChatViewManager.ChatSynced += OnChatViewManagerChatSynced;
            ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

            #if GTK_SHARP_2_10
            StatusIconManager = new StatusIconManager(this, ChatViewManager);
            #endif
            #if INDICATE_SHARP || MESSAGING_MENU_SHARP
            IndicateManager = new IndicateManager(this, ChatViewManager);
            #endif
            #if NOTIFY_SHARP
            NotifyManager = new NotifyManager(this, ChatViewManager);
            #endif
            #if IPC_DBUS
            NetworkManager = new NetworkManager(ChatViewManager);
            #endif

            UI = new GnomeUI(ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            EngineManager = new EngineManager(Frontend.FrontendConfig, UI);

            Entry = new Entry(ChatViewManager);
            var entryScrolledWindow = new Gtk.ScrolledWindow();
            entryScrolledWindow.ShadowType = Gtk.ShadowType.EtchedIn;
            entryScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never;
            entryScrolledWindow.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args) {
                // predict and set useful heigth
                int lineWidth, lineHeigth;
                using (var layout = Entry.CreatePangoLayout("Qp")) {
                    layout.GetPixelSize(out lineHeigth, out lineHeigth);
                }
                var it = Entry.Buffer.StartIter;
                int newLines = 1;
                // move to end of next visual line
                while (Entry.ForwardDisplayLineEnd(ref it)) {
                    newLines++;
                    // calling ForwardDisplayLineEnd repeatedly stays on the same position
                    // therefor we move one cursor position further
                    it.ForwardCursorPosition();
                }
                newLines = Math.Min(newLines, 3);
                // use text heigth + a bit extra
                var bestSize = new Gtk.Requisition() {
                    Height = (lineHeigth * newLines) + 5
                };
                args.Requisition = bestSize;
            };
            entryScrolledWindow.Add(Entry);

            ProgressBar = new Gtk.ProgressBar();
            StatusHBox = new Gtk.HBox();

            MenuWidget = new MenuWidget(this, ChatViewManager);

            var treeviewScrolledWindow = new Gtk.ScrolledWindow() {
                ShadowType = Gtk.ShadowType.EtchedIn,
                HscrollbarPolicy = Gtk.PolicyType.Never,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            treeviewScrolledWindow.Add(ChatTreeView);
            ChatViewManager.ChatAdded += (sender, e) => {
                treeviewScrolledWindow.CheckResize();
            };

            var notebookPaned = new Gtk.VPaned();
            notebookPaned.Pack1(Notebook, true, false);
            notebookPaned.Pack2(entryScrolledWindow, false, false);

            var treeviewPaned = new Gtk.HPaned();
            treeviewPaned.Pack1(treeviewScrolledWindow, false, false);
            treeviewPaned.Pack2(notebookPaned, true, false);
            TreeViewHPaned = treeviewPaned;

            var entryPaned = new Gtk.VPaned();
            entryPaned.ButtonPressEvent += (sender, e) => {
                // reset entry size on double click
                if (e.Event.Type == Gdk.EventType.TwoButtonPress &&
                    e.Event.Button == 1) {
                    GLib.Timeout.Add(100, delegate {
                        entryPaned.Position = -1;
                        return false;
                    });
                }
            };
            entryPaned.Pack1(treeviewPaned, true, false);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(MenuWidget, false, false, 0);
            vbox.PackStart(entryPaned, true, true, 0);

            NetworkStatusbar = new Gtk.Statusbar();
            NetworkStatusbar.WidthRequest = 300;
            NetworkStatusbar.HasResizeGrip = false;

            Statusbar = new Gtk.Statusbar();
            Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(Statusbar, true, true, 0);

            StatusHBox.PackStart(status_bar_hbox);
            StatusHBox.PackStart(ProgressBar, false, false, 0);
            StatusHBox.ShowAll();
            StatusHBox.NoShowAll = true;
            StatusHBox.Visible = (bool) Frontend.FrontendConfig["ShowStatusBar"];

            vbox.PackStart(StatusHBox, false, false, 0);
            Add(vbox);
        }
示例#3
0
        public override void ApplyConfig(UserConfig config)
        {
            Trace.Call(config);

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            base.ApplyConfig(config);

            // topic
            _TopicTextView.ApplyConfig(config);
            string topic_pos = (string)config["Interface/Notebook/Channel/TopicPosition"];

            if (_TopicScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(_TopicScrolledWindow);
            }
            if (OutputScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(OutputScrolledWindow);
            }
            if (topic_pos == "top")
            {
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2);
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else if (topic_pos == "bottom")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2);
            }
            else if (topic_pos == "none")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/TopicPosition: " + topic_pos);
#endif
            }
            _OutputVBox.ShowAll();

            // person list
            if (ThemeSettings.BackgroundColor == null)
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal, ThemeSettings.BackgroundColor.Value);
            }
            if (ThemeSettings.ForegroundColor == null)
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal, ThemeSettings.ForegroundColor.Value);
            }
            _PersonTreeView.ModifyFont(ThemeSettings.FontDescription);

            string userlist_pos = (string)config["Interface/Notebook/Channel/UserListPosition"];
            if (userlist_pos == "left")
            {
                userlist_pos = "right";
            }
            if (_PersonTreeViewFrame.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_PersonTreeViewFrame);
            }
            if (_OutputVBox.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_OutputVBox);
            }
            if (userlist_pos == "left")
            {
                _OutputHPaned.Pack1(_PersonTreeViewFrame, false, true);
                _OutputHPaned.Pack2(_OutputVBox, true, true);
            }
            else if (userlist_pos == "right")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
                _OutputHPaned.Pack2(_PersonTreeViewFrame, false, true);
            }
            else if (userlist_pos == "none")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/UserListPosition: " + userlist_pos);
#endif
            }
            _OutputHPaned.ShowAll();

            NickColors = (bool)config["Interface/Notebook/Channel/NickColors"];
        }
示例#4
0
        private void BuildNotebook()
        {
            var vBox = new Gtk.VBox( false, 5 );
            var hBox = new Gtk.HPaned();
            this.nbDocPages = new Gtk.Notebook();
            this.nbDocPages.SwitchPage += (o, args) => this.OnCurrentPageChanged();

            // Text view for the document
            var swScrollText = new Gtk.ScrolledWindow();
            this.txtDocument = new Gtk.TextView { Editable = false };
            swScrollText.AddWithViewport( this.txtDocument );
            this.txtDocument.FocusOutEvent += (o, args) => this.StoreQuestionText();

            // Test treeview
            this.tvDocument = new Gtk.TreeView();
            var swScroll = new Gtk.ScrolledWindow();
            var frmTest = new Gtk.Frame( "Test" );
            ( (Gtk.Label) frmTest.LabelWidget ).Markup = "<b>Test</b>";
            frmTest.Add( swScroll );
            swScroll.AddWithViewport( this.tvDocument );

            // Frame question
            var frmQuestion = new Gtk.Frame( "Question" );
            var swScrolledQuestion = new Gtk.ScrolledWindow();
            ( (Gtk.Label) frmQuestion.LabelWidget ).Markup = "<b>Question</b>";
            this.edQuestionText = new Gtk.TextView();
            this.edQuestionText.KeyReleaseEvent += (o, args) => this.OnQuestionTextChanged();
            swScrolledQuestion.AddWithViewport( edQuestionText );
            frmQuestion.Add( swScrolledQuestion );
            vBox.PackStart( frmQuestion, false, false, 5 );

            // Frame answers
            var bttAnswers = new Gtk.HButtonBox();
            var vBoxAnswers = new Gtk.VBox( false, 5 );
            var frmAnswer = new Gtk.Frame( "Answer" );
            var hBoxAnswers = new Gtk.HBox( false, 5 );
            var hBoxCorrect = new Gtk.HBox( false, 5 );
            var swScrolledAnswers = new Gtk.ScrolledWindow();
            ( (Gtk.Label) frmAnswer.LabelWidget ).Markup = "<b>Answer</b>";
            this.tvAnswers = new Gtk.TreeView();
            swScrolledAnswers.Add( this.tvAnswers );
            this.btAddAnswer = new Gtk.Button( new Gtk.Image( this.iconAdd.ScaleSimple( 16, 16, InterpType.Bilinear ) ) );
            this.btAddAnswer.Clicked += (sender, e) => this.AddAnswer();
            this.btRemoveAnswer = new Gtk.Button( new Gtk.Image( this.iconRemove.ScaleSimple( 16, 16, InterpType.Bilinear ) ) );
            this.btRemoveAnswer.Clicked += (sender, e) => this.RemoveAnswer();
            bttAnswers.Add( this.btAddAnswer );
            bttAnswers.Add( this.btRemoveAnswer );
            bttAnswers.Layout = Gtk.ButtonBoxStyle.Center;
            bttAnswers.Spacing = 20;
            hBoxAnswers.PackStart( swScrolledAnswers, true, true, 5 );
            vBoxAnswers.PackStart( hBoxAnswers, true, true, 5 );
            this.spNumberValidAnswer = new Gtk.SpinButton( 1, 20, 1 );
            this.spNumberValidAnswer.ValueChanged += (o, args) => this.OnCorrectAnswerChanged();
            hBoxCorrect.PackStart( new Gtk.Label( "Correct answer:" ), false, false, 5 );
            hBoxCorrect.PackStart( this.spNumberValidAnswer, false, false, 5 );
            hBoxCorrect.PackEnd( bttAnswers, false, false, 5 );
            vBoxAnswers.PackStart( hBoxCorrect, false, false, 5 );
            frmAnswer.Add( vBoxAnswers );
            vBox.PackStart( frmAnswer, true, true, 5 );

            // Layout
            hBox.Pack1( frmTest, false, false );
            hBox.Pack2( vBox, false, false );
            this.nbDocPages.AppendPage( hBox, new Gtk.Label( "Edit" ) );
            this.nbDocPages.AppendPage( swScrollText, new Gtk.Label( "Document" ) );
            this.nbDocPages.Page = 0;
        }
示例#5
0
        public MainWindow() : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null)
            {
                width = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            }
            else
            {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null)
            {
                heigth = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            }
            else
            {
                heigth = 600;
            }
            if (width < -1 || heigth < -1)
            {
                width  = -1;
                heigth = -1;
            }
            if (width == -1 && heigth == -1)
            {
                SetDefaultSize(800, 600);
                Maximize();
            }
            else if (width == 0 && heigth == 0)
            {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            }
            else
            {
                SetDefaultSize(width, heigth);
            }

            int x, y;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null)
            {
                x = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            }
            else
            {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null)
            {
                y = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            }
            else
            {
                y = 0;
            }
            if (x < 0 || y < 0)
            {
                x = 0;
                y = 0;
            }
            if (x == 0 && y == 0)
            {
                SetPosition(Gtk.WindowPosition.Center);
            }
            else
            {
                Move(x, y);
            }

            DeleteEvent      += OnDeleteEvent;
            FocusInEvent     += OnFocusInEvent;
            FocusOutEvent    += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            ChatTreeView = new ChatTreeView();

            Notebook               = new Notebook();
            Notebook.SwitchPage   += OnNotebookSwitchPage;
            Notebook.FocusInEvent += OnNotebookFocusInEvent;

            ChatViewManager = new ChatViewManager(Notebook, ChatTreeView);
            Assembly asm = Assembly.GetExecutingAssembly();

            ChatViewManager.Load(asm);
            ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                    "smuxi-frontend-gnome-*.dll");
            ChatViewManager.ChatAdded   += OnChatViewManagerChatAdded;
            ChatViewManager.ChatSynced  += OnChatViewManagerChatSynced;
            ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

#if GTK_SHARP_2_10
            StatusIconManager = new StatusIconManager(this, ChatViewManager);
#endif
#if INDICATE_SHARP || MESSAGING_MENU_SHARP
            IndicateManager = new IndicateManager(this, ChatViewManager);
#endif
#if NOTIFY_SHARP
            NotifyManager = new NotifyManager(this, ChatViewManager);
#endif
#if IPC_DBUS
            NetworkManager = new NetworkManager(ChatViewManager);
#endif

            UI = new GnomeUI(ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            EngineManager = new EngineManager(Frontend.FrontendConfig, UI);

            Entry = new Entry(ChatViewManager);
            var entryScrolledWindow = new Gtk.ScrolledWindow();
            entryScrolledWindow.ShadowType       = Gtk.ShadowType.EtchedIn;
            entryScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never;
            entryScrolledWindow.SizeRequested   += delegate(object o, Gtk.SizeRequestedArgs args) {
                // predict and set useful height
                int lineWidth, lineHeight;
                using (var layout = Entry.CreatePangoLayout("Qp")) {
                    layout.GetPixelSize(out lineWidth, out lineHeight);
                }
                var it       = Entry.Buffer.StartIter;
                int newLines = 1;
                // move to end of next visual line
                while (Entry.ForwardDisplayLineEnd(ref it))
                {
                    newLines++;
                    // calling ForwardDisplayLineEnd repeatedly stays on the same position
                    // therefor we move one cursor position further
                    it.ForwardCursorPosition();
                }
                newLines = Math.Min(newLines, 3);
                // use text heigth + a bit extra
                var bestSize = new Gtk.Requisition()
                {
                    Height = (lineHeight * newLines) + 5
                };
                args.Requisition = bestSize;
            };
            entryScrolledWindow.Add(Entry);

            ProgressBar = new Gtk.ProgressBar();
            StatusHBox  = new Gtk.HBox();

            MenuWidget = new MenuWidget(this, ChatViewManager);

            var treeviewScrolledWindow = new Gtk.ScrolledWindow()
            {
                ShadowType       = Gtk.ShadowType.EtchedIn,
                HscrollbarPolicy = Gtk.PolicyType.Never,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            treeviewScrolledWindow.Add(ChatTreeView);
            ChatViewManager.ChatAdded += (sender, e) => {
                treeviewScrolledWindow.CheckResize();
            };

            var notebookPaned = new Gtk.VPaned();
            notebookPaned.Pack1(Notebook, true, false);
            notebookPaned.Pack2(entryScrolledWindow, false, false);

            var treeviewPaned = new Gtk.HPaned();
            treeviewPaned.Pack1(treeviewScrolledWindow, false, false);
            treeviewPaned.Pack2(notebookPaned, true, false);
            TreeViewHPaned = treeviewPaned;

            var entryPaned = new Gtk.VPaned();
            entryPaned.ButtonPressEvent += (sender, e) => {
                // reset entry size on double click
                if (e.Event.Type == Gdk.EventType.TwoButtonPress &&
                    e.Event.Button == 1)
                {
                    GLib.Timeout.Add(100, delegate {
                        entryPaned.Position = -1;
                        return(false);
                    });
                }
            };
            entryPaned.Pack1(treeviewPaned, true, false);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(MenuWidget, false, false, 0);
            vbox.PackStart(entryPaned, true, true, 0);

            NetworkStatusbar = new Gtk.Statusbar();
            NetworkStatusbar.WidthRequest  = 300;
            NetworkStatusbar.HasResizeGrip = false;

            Statusbar = new Gtk.Statusbar();
            Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(Statusbar, true, true, 0);

            StatusHBox.PackStart(status_bar_hbox);
            StatusHBox.PackStart(ProgressBar, false, false, 0);
            StatusHBox.ShowAll();
            StatusHBox.NoShowAll = true;
            StatusHBox.Visible   = (bool)Frontend.FrontendConfig["ShowStatusBar"];

            vbox.PackStart(StatusHBox, false, false, 0);
            Add(vbox);
        }
示例#6
0
        public override void ApplyConfig(UserConfig config)
        {
            Trace.Call(config);

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            base.ApplyConfig(config);

            // topic
            _TopicTextView.ApplyConfig(config);
            // predict and set useful topic heigth
            Pango.Layout layout = _TopicTextView.CreatePangoLayout("Test Topic");
            int          lineWidth, lineHeigth;

            layout.GetPixelSize(out lineWidth, out lineHeigth);
            // use 2 lines + a bit extra as the topic heigth
            int bestHeigth = (lineHeigth * 2) + 5;

            _TopicTextView.HeightRequest       = bestHeigth;
            _TopicScrolledWindow.HeightRequest = bestHeigth;

            string topic_pos = (string)config["Interface/Notebook/Channel/TopicPosition"];

            if (_TopicScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(_TopicScrolledWindow);
            }
            if (OutputScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(OutputScrolledWindow);
            }
            if (topic_pos == "top")
            {
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2);
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else if (topic_pos == "bottom")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2);
            }
            else if (topic_pos == "none")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/TopicPosition: " + topic_pos);
#endif
            }
            _OutputVBox.ShowAll();

            // person list
            if (ThemeSettings.BackgroundColor == null)
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal, ThemeSettings.BackgroundColor.Value);
            }
            if (ThemeSettings.ForegroundColor == null)
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal, ThemeSettings.ForegroundColor.Value);
            }
            _PersonTreeView.ModifyFont(ThemeSettings.FontDescription);

            string userlist_pos = (string)config["Interface/Notebook/Channel/UserListPosition"];
            if (_PersonTreeViewFrame.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_PersonTreeViewFrame);
            }
            if (_OutputVBox.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_OutputVBox);
            }
            if (userlist_pos == "left")
            {
                _OutputHPaned.Pack1(_PersonTreeViewFrame, false, false);
                _OutputHPaned.Pack2(_OutputVBox, true, true);
            }
            else if (userlist_pos == "right")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
                _OutputHPaned.Pack2(_PersonTreeViewFrame, false, false);
            }
            else if (userlist_pos == "none")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/UserListPosition: " + userlist_pos);
#endif
            }
            _OutputHPaned.ShowAll();

            NickColors = (bool)config["Interface/Notebook/Channel/NickColors"];
        }