Commit 6ba7ac99 authored by Victor Yacovlev's avatar Victor Yacovlev

Implemented simple help viewer behaviour (#kumir2-1813)

parent 898263d7
......@@ -73,7 +73,7 @@ ContentView::ContentView(QWidget *parent)
QSize ContentView::minimumSizeHint() const
{
return QSize(500, 230);
return QSize(80, 230);
}
void ContentView::reset()
......@@ -1201,7 +1201,7 @@ QVariant ContentView::loadResource(int type, const QUrl &name)
QVariant result;
bool ignore = true;
if (type == QTextDocument::ImageResource) {
const QString link = name.toString();
const QString link = name.path();
if (link.startsWith("model_ptr:")) {
ignore = false;
QByteArray linkPtr = QByteArray::fromHex(link.toLatin1().mid(10));
......
......@@ -76,6 +76,8 @@ DocBookViewImpl::DocBookViewImpl(DocBookView *pClass)
background_->setStyleSheet("background-color: rgba(0,0,0,192);");
sidePanel_->setAutoFillBackground(true);
splitter_->handle(1)->setAutoFillBackground(true);
switchToCompactMode(true);
}
......@@ -121,7 +123,7 @@ void DocBookViewImpl::setSize(const QSize &size)
background_->move(0, 0);
background_->resize(size);
if (size.width() < minWidth) {
switchToCompactMode();
// switchToCompactMode();
}
else {
switchToEnoughtSizeMode();
......@@ -175,8 +177,12 @@ void DocBookViewImpl::showSidePanel()
QSize DocBookViewImpl::minimumSizeHint() const
{
int minW = qMax(sidePanel_->minimumSizeHint().width(),
content_->minimumSizeHint().width());
// int minW = qMax(sidePanel_->minimumSizeHint().width(),
// content_->minimumSizeHint().width());
int minW = sidePanel_->minimumSizeHint().width() +
content_->minimumSizeHint().width() +
splitter_->handleWidth();
minW = qMax(minW, 300);
int minH = qMax(sidePanel_->minimumSizeHint().height(),
content_->minimumSizeHint().height());
return QSize(minW, minH);
......
......@@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>200</width>
<width>180</width>
<height>0</height>
</size>
</property>
......@@ -29,13 +29,31 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame">
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
......@@ -132,7 +150,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -179,7 +206,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -226,7 +262,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -273,7 +318,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment