uisupport: Forcefully disable horizontal scrollbar in BufferView
[quassel.git] / src / uisupport / bufferview.cpp
index 7986118..7d7490f 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2016 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -73,6 +73,8 @@ void BufferView::init()
 
     header()->hide(); // nobody seems to use this anyway
 
+    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
     // breaks with Qt 4.8
     if (QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10!
         setAnimated(true);
@@ -709,6 +711,14 @@ BufferViewDock::BufferViewDock(BufferViewConfig *config, QWidget *parent)
     QDockWidget::setWidget(_widget);
 }
 
+void BufferViewDock::setLocked(bool locked) {
+    if (locked) {
+        setFeatures(0);
+    }
+    else {
+        setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
+    }
+}
 
 void BufferViewDock::updateTitle()
 {