Skip to content

Commit

Permalink
few visual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jul 1, 2018
1 parent 45e260f commit a97b113
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 28 deletions.
28 changes: 20 additions & 8 deletions src/gui/AstroCalcDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void AstroCalcDialog::createDialogContent()
ui->dateToDateTimeEdit->setDateTime(currentDT.addMonths(1));
ui->phenomenFromDateEdit->setDateTime(currentDT);
ui->phenomenToDateEdit->setDateTime(currentDT.addMonths(1));
ui->monthlyElevationTimeInfo->setStyleSheet("font-size: 18pt");
ui->monthlyElevationTimeInfo->setStyleSheet("font-size: 18pt; color: rgb(238, 238, 238);");

// TODO: Switch a QDateTimeEdit to StelDateTimeEdit widget to apply wide range of dates
QDate min = QDate(100, 1, 1);
Expand Down Expand Up @@ -295,13 +295,25 @@ void AstroCalcDialog::createDialogContent()

updateTabBarListWidgetWidth();

// Let's improve visibility of rise, set and transit times
ui->labelRise->setStyleSheet("QLabel { color: white; }");
ui->labelRiseValue->setStyleSheet("QLabel { color: white; }");
ui->labelTransit->setStyleSheet("QLabel { color: white; }");
ui->labelTransitValue->setStyleSheet("QLabel { color: white; }");
ui->labelSet->setStyleSheet("QLabel { color: white; }");
ui->labelSetValue->setStyleSheet("QLabel { color: white; }");
// Let's improve visibility of the text
QString style = "QLabel { color: rgb(238, 238, 238); }";
ui->celestialPositionsTimeLabel->setStyleSheet(style);
ui->altVsTimeLabel->setStyleSheet(style);
ui->monthlyElevationLabel->setStyleSheet(style);
ui->graphsFirstLabel->setStyleSheet(style);
ui->graphsCelestialBodyLabel->setStyleSheet(style);
ui->graphsSecondLabel->setStyleSheet(style);
ui->labelRise->setStyleSheet(style);
ui->labelRiseValue->setStyleSheet(style);
ui->labelTransit->setStyleSheet(style);
ui->labelTransitValue->setStyleSheet(style);
ui->labelSet->setStyleSheet(style);
ui->labelSetValue->setStyleSheet(style);
style = "QCheckBox { color: rgb(238, 238, 238); }";
ui->sunAltitudeCheckBox->setStyleSheet(style);
ui->moonAltitudeCheckBox->setStyleSheet(style);
ui->positiveAltitudeOnlyCheckBox->setStyleSheet(style);
ui->monthlyElevationPositiveCheckBox->setStyleSheet(style);
}

void AstroCalcDialog::updateAstroCalcData()
Expand Down
9 changes: 9 additions & 0 deletions src/gui/LocationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void LocationDialog::retranslate()
populatePlanetList();
populateCountryList();
populateTimeZonesList();
populateTooltips();
}
}

Expand Down Expand Up @@ -174,6 +175,8 @@ void LocationDialog::createDialogContent()

connectEditSignals();

populateTooltips();

connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(updateFromProgram(StelLocation)));

ui->citySearchLineEdit->setFocus();
Expand All @@ -192,6 +195,12 @@ void LocationDialog::reloadLocations()
allModel->setStringList(StelApp::getInstance().getLocationMgr().getAllMap().keys());
}

void LocationDialog::populateTooltips()
{
ui->resetListPushButton->setToolTip(q_("Reset location list to show all known locations"));
ui->gpsToolButton->setToolTip(QString("<p>%1</p>").arg(q_("Toggle fetching GPS location. (Does not change time zone!) When satisfied, toggle off to let other programs access the GPS device.")));
}

// Update the widget to make sure it is synchrone if the location is changed programmatically
void LocationDialog::updateFromProgram(const StelLocation& currentLocation)
{
Expand Down
3 changes: 3 additions & 0 deletions src/gui/LocationDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public slots:
//! The original names are kept in the user data field of each QComboBox
//! item.
void populateTimeZonesList();

//! Populates tooltips for GUI elements.
void populateTooltips();

private slots:
//! Called whenever the StelLocationMgr is updated
Expand Down
26 changes: 13 additions & 13 deletions src/gui/astroCalcDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,19 @@
</widget>
<widget class="QWidget" name="stackedWidgetPage8">
<layout class="QGridLayout" name="gridLayout_8">
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>148</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayoutPCalc">
<item row="7" column="1">
Expand Down Expand Up @@ -1330,19 +1343,6 @@
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>148</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
Expand Down
8 changes: 1 addition & 7 deletions src/gui/locationDialogGui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>630</width>
<height>511</height>
<height>533</height>
</rect>
</property>
<property name="styleSheet">
Expand Down Expand Up @@ -379,9 +379,6 @@
</item>
<item>
<widget class="QPushButton" name="resetListPushButton">
<property name="toolTip">
<string>Reset location list to show all known locations</string>
</property>
<property name="text">
<string>Reset Location List</string>
</property>
Expand Down Expand Up @@ -656,9 +653,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Toggle fetching GPS location. (Does not change time zone!) When satisfied, toggle off to let other programs access the GPS device.</string>
</property>
<property name="text">
<string>Get location from GPS</string>
</property>
Expand Down

0 comments on commit a97b113

Please sign in to comment.