[Marble-commits] KDE/kdeedu/marble/src/plugins/render/positionmarker
Torsten Rahn
tackat at kde.org
Wed Jan 5 15:54:21 CET 2011
SVN commit 1212029 by rahn:
- Tweaking the color selection a bit.
M +10 -11 PositionMarker.cpp
M +17 -32 PositionMarkerConfigWidget.ui
--- trunk/KDE/kdeedu/marble/src/plugins/render/positionmarker/PositionMarker.cpp #1212028:1212029
@@ -315,9 +315,9 @@
}
ui_configWidget->m_sizeLabel->setText( tr( "Cursor Size: %1" ).arg( cursorSize ) );
- QPalette palette;
- palette.setColor( QPalette::Background, QColor( m_settings.value( "acColor" ).value<QColor>()) );
- ui_configWidget->m_acColorPreview->setPalette( palette );
+ QPalette palette = ui_configWidget->m_acColorChooserButton->palette();
+ palette.setColor( QPalette::Button, QColor( m_settings.value( "acColor" ).value<QColor>()) );
+ ui_configWidget->m_acColorChooserButton->setPalette( palette );
}
void PositionMarker::writeSettings()
@@ -369,7 +369,7 @@
}
else
{
- QMessageBox::warning( NULL, tr( "Error" ), tr( "Unable to load custom cursor, default cursor will be used. "
+ QMessageBox::warning( NULL, tr( "Position Marker Plugin" ), tr( "Unable to load custom cursor, default cursor will be used. "
"Make sure this is a valid image file." ), QMessageBox::Ok );
ui_configWidget->m_fileChooserButton->setIcon( QIcon( m_defaultCursor ) );
m_customCursor = m_defaultCursor;
@@ -384,16 +384,15 @@
void PositionMarker::chooseAccuracyCircleColor()
{
- QColorDialog dialog( m_acColor );
- dialog.setOptions( QColorDialog::ShowAlphaChannel );
- dialog.exec();
- QColor c = dialog.selectedColor();
+ QColor c = QColorDialog::getColor( m_acColor, 0,
+ "Please choose the color for the accuracy circle",
+ QColorDialog::ShowAlphaChannel );
if( c.isValid() )
{
m_acColor = c;
- QPalette palette;
- palette.setColor( QPalette::Background, m_acColor );
- ui_configWidget->m_acColorPreview->setPalette( palette );
+ QPalette palette = ui_configWidget->m_acColorChooserButton->palette();
+ palette.setColor( QPalette::Button, m_acColor );
+ ui_configWidget->m_acColorChooserButton->setPalette( palette );
}
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/positionmarker/PositionMarkerConfigWidget.ui #1212028:1212029
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>498</width>
- <height>400</height>
+ <width>410</width>
+ <height>297</height>
</rect>
</property>
<property name="windowTitle">
@@ -145,49 +145,34 @@
<property name="title">
<string>Colors</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <widget class="QPushButton" name="m_acColorChooserButton">
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="m_accuracyLabel">
<property name="text">
- <string>Accuracy Circle Color</string>
+ <string>Accuracy:</string>
</property>
</widget>
</item>
- <item>
- <widget class="QWidget" name="m_acColorPreview" native="true">
+ <item row="0" column="1">
+ <widget class="QPushButton" name="m_acColorChooserButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
- <width>50</width>
+ <width>30</width>
<height>30</height>
</size>
</property>
- <property name="autoFillBackground">
- <bool>true</bool>
+ <property name="text">
+ <string/>
</property>
- <zorder>horizontalSpacer_2</zorder>
</widget>
</item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
- </item>
- </layout>
</widget>
</item>
<item>
More information about the Marble-commits
mailing list