Skip to content
Permalink
Browse files

Label preview of adv labeling is collapsible

  • Loading branch information
dakcarto committed Sep 15, 2012
1 parent 8f0cb99 commit d0800fbff9dc93d788f298ce0ea98edea777e662
Showing with 46 additions and 2 deletions.
  1. +19 −0 src/app/qgslabelinggui.cpp
  2. +1 −0 src/app/qgslabelinggui.h
  3. +26 −2 src/ui/qgslabelingguibase.ui
@@ -278,12 +278,31 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
mBufferAttributesPropertiesGroupBox->setCollapsed( true );
mFontAttributePropertiesGroupBox->setCollapsed( true );

connect( groupBox_mPreview,
SIGNAL( collapsedStateChanged( QgsCollapsibleGroupBox* ) ),
this,
SLOT( collapseSample( QgsCollapsibleGroupBox* ) ) );
}

QgsLabelingGui::~QgsLabelingGui()
{
}

void QgsLabelingGui::collapseSample( QgsCollapsibleGroupBox* grpbx )
{
if ( grpbx->isCollapsed() )
{
QList<int> splitSizes = mFontPreviewSplitter->sizes();
if ( splitSizes[0] > grpbx->height() )
{
int delta = splitSizes[0] - grpbx->height();
splitSizes[0] -= delta;
splitSizes[1] += delta;
mFontPreviewSplitter->setSizes( splitSizes );
}
}
}

void QgsLabelingGui::apply()
{
QgsPalLayerSettings settings = layerSettings();
@@ -38,6 +38,7 @@ class QgsLabelingGui : public QWidget, private Ui::QgsLabelingGuiBase
QgsPalLayerSettings layerSettings();

public slots:
void collapseSample( QgsCollapsibleGroupBox* grpbx );
void apply();
void changeTextColor();
void changeTextFont();
@@ -33,6 +33,15 @@
<item row="0" column="0">
<widget class="QFrame" name="frameLabelWith">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="chkEnableLabeling">
<property name="text">
@@ -154,10 +163,13 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="handleWidth">
<number>10</number>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QGroupBox" name="groupBox_mPreview">
<widget class="QgsCollapsibleGroupBox" name="groupBox_mPreview">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
@@ -173,11 +185,23 @@
<property name="title">
<string>Sample</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>

0 comments on commit d0800fb

Please sign in to comment.
You can’t perform that action at this time.