Skip to content
Permalink
Browse files

better floater display (also for dark backgrounds)

  • Loading branch information
olivierdalang committed May 15, 2019
1 parent 04d7e2a commit 9029d7e695951a53bc57dbe6e199d5a3c5e58adf
Showing with 93 additions and 43 deletions.
  1. +9 −1 src/gui/qgsadvanceddigitizingfloater.cpp
  2. +84 −42 src/ui/qgsadvanceddigitizingfloaterbase.ui
@@ -27,8 +27,9 @@ QgsAdvancedDigitizingFloater::QgsAdvancedDigitizingFloater( QgsMapCanvas *canvas
: QWidget( canvas->viewport() ), mMapCanvas( canvas ), mCadDockWidget( cadDockWidget )
{
setupUi( this );
setWindowFlag( Qt::FramelessWindowHint );

setAttribute( Qt::WA_TransparentForMouseEvents );
adjustSize();

setActive( QgsSettings().value( QStringLiteral( "/Cad/Floater" ), false ).toBool() );

@@ -235,6 +236,7 @@ void QgsAdvancedDigitizingFloater::changeRelativeX( bool relative )
{
mXLabel->setText( "Δx" );
}
adjustSize();
}

void QgsAdvancedDigitizingFloater::changeRelativeY( bool relative )
@@ -247,6 +249,7 @@ void QgsAdvancedDigitizingFloater::changeRelativeY( bool relative )
{
mYLabel->setText( "Δy" );
}
adjustSize();
}

// distance is always relative
@@ -261,6 +264,7 @@ void QgsAdvancedDigitizingFloater::changeRelativeAngle( bool relative )
{
mAngleLabel->setText( "Δa" );
}
adjustSize();
}

void QgsAdvancedDigitizingFloater::focusOnX()
@@ -304,22 +308,26 @@ void QgsAdvancedDigitizingFloater::enabledChangedX( bool enabled )
{
mXLineEdit->setVisible( enabled );
mXLabel->setVisible( enabled );
adjustSize();
}

void QgsAdvancedDigitizingFloater::enabledChangedY( bool enabled )
{
mYLineEdit->setVisible( enabled );
mYLabel->setVisible( enabled );
adjustSize();
}

void QgsAdvancedDigitizingFloater::enabledChangedDistance( bool enabled )
{
mDistanceLineEdit->setVisible( enabled );
mDistanceLabel->setVisible( enabled );
adjustSize();
}

void QgsAdvancedDigitizingFloater::enabledChangedAngle( bool enabled )
{
mAngleLineEdit->setVisible( enabled );
mAngleLabel->setVisible( enabled );
adjustSize();
}
@@ -6,13 +6,56 @@
<rect>
<x>0</x>
<y>0</y>
<width>150</width>
<height>120</height>
<width>279</width>
<height>142</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="127">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="127">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit{background-color: rgba(255,255,255,127)}</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
@@ -24,31 +67,38 @@
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
<number>2</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="2" column="1">
<widget class="QLabel" name="mDistanceLabel">
<property name="text">
<string>d</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="mAngleLabel">
<property name="text">
<string>Δa</string>
<string>a</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="mDistanceLineEdit">
<property name="toolTip">
<string/>
</property>
<item row="4" column="1">
<widget class="QLabel" name="mXLabel">
<property name="text">
<string>-</string>
</property>
<property name="frame">
<bool>false</bool>
<string>x</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@@ -71,6 +121,22 @@
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="mDistanceLineEdit">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>-</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLineEdit" name="mXLineEdit">
<property name="minimumSize">
@@ -90,18 +156,14 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="mXLabel">
<property name="text">
<string>x</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="mYLabel">
<property name="text">
<string>y</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="3">
@@ -123,26 +185,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="mDistanceLabel">
<property name="text">
<string>d</string>
</property>
</widget>
</item>
<item row="6" column="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>

0 comments on commit 9029d7e

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