Commit 49e67a8c authored by Jason Harris's avatar Jason Harris
Browse files

TransientLabel fixes:

Added option to disable transient labels
Transient labels now have same font size as other labels
When label fades all the way, it is immediately erased
(noticed this if transientLabel appears on top of another
label)

CCMAIL: kstars-devel@kde.org

svn path=/trunk/kdeedu/kstars/; revision=289266
parent eea1db82
......@@ -163,6 +163,7 @@ void KStarsData::loadOptions()
options->useRefraction = conf->readBoolEntry( "UseRefraction", true );
options->useAnimatedSlewing = conf->readBoolEntry( "AnimateSlewing", true );
options->useAutoLabel = conf->readBoolEntry( "UseAutoLabel", true );
options->useHoverLabel = conf->readBoolEntry( "UseHoverLabel", true );
options->useAutoTrail = conf->readBoolEntry( "UseAutoTrail", true );
options->fadePlanetTrails = conf->readBoolEntry( "FadePlanetTrails", true );
options->hideOnSlew = conf->readBoolEntry( "HideOnSlew", true );
......@@ -321,6 +322,7 @@ void KStarsData::saveOptions(KStars *ks) {
conf->writeEntry( "UseRefraction", options->useRefraction );
conf->writeEntry( "AnimateSlewing", options->useAnimatedSlewing );
conf->writeEntry( "UseAutoLabel", options->useAutoLabel );
conf->writeEntry( "UseHoverLabel", options->useHoverLabel );
conf->writeEntry( "UseAutoTrail", options->useAutoTrail );
conf->writeEntry( "FadePlanetTrails", options->fadePlanetTrails );
conf->writeEntry( "HideOnSlew", options->hideOnSlew );
......
......@@ -1747,7 +1747,7 @@ void KStarsData::updateTime( GeoLocation *geo, SkyMap *skymap, const bool automa
setLST();
//Check for mouse Hover:
skymap->checkHoverPoint();
if ( options->useHoverLabel ) skymap->checkHoverPoint();
//Only check DST if (1) TZrule is not the empty rule, and (2) if we have crossed
//the DST change date/time.
......
......@@ -239,6 +239,7 @@ void KStars::changeViewOption( const QString op, const QString val ) {
if ( op == "UseAltAz" && bOk ) options()->useAltAz = bVal;
if ( op == "UseRefraction" && bOk ) options()->useRefraction = bVal;
if ( op == "UseAutoLabel" && bOk ) options()->useAutoLabel = bVal;
if ( op == "UseHoverLabel" && bOk ) options()->useHoverLabel = bVal;
if ( op == "UseAutoTrail" && bOk ) options()->useAutoTrail = bVal;
if ( op == "AnimateSlewing" && bOk ) options()->useAnimatedSlewing = bVal;
if ( op == "FadePlanetTrails" && bOk ) options()->fadePlanetTrails = bVal;
......
......@@ -36,6 +36,7 @@ KStarsOptions::KStarsOptions(KStarsOptions& o) {
useLocalConstellNames = o.useLocalConstellNames;
useAbbrevConstellNames = o.useAbbrevConstellNames;
useAutoLabel = o.useAutoLabel;
useHoverLabel = o.useHoverLabel;
useAutoTrail = o.useAutoTrail;
fadePlanetTrails = o.fadePlanetTrails;
drawSAO = o.drawSAO;
......@@ -156,6 +157,7 @@ void KStarsOptions::setDefaultOptions() {
useLocalConstellNames = false;
useAbbrevConstellNames = false;
useAutoLabel = true;
useHoverLabel = true;
useAutoTrail = true;
fadePlanetTrails = true;
drawSAO = true;
......
......@@ -154,6 +154,7 @@ class KStarsOptions {
bool useRefraction;
bool useAnimatedSlewing;
bool useAutoLabel;
bool useHoverLabel;
bool useAutoTrail;
bool fadePlanetTrails;
bool hideOnSlew;
......
......@@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>383</width>
<height>399</height>
<height>474</height>
</rect>
</property>
<property name="caption">
......@@ -61,6 +61,20 @@
<string>If checked, a name label will be temporarily attached to an object while it is centered in the display. You can attach a more persistent label to any object using the right-click popup menu.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>hoverLabel</cstring>
</property>
<property name="text">
<string>Attach temporary label when hovering mouse</string>
</property>
<property name="toolTip" stdset="0">
<string>Show name label of centered object?</string>
</property>
<property name="whatsThis" stdset="0">
<string>If checked, a name label will be temporarily attached to an object while it is centered in the display. You can attach a more persistent label to any object using the right-click popup menu.</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer20</cstring>
......@@ -409,7 +423,7 @@
</customwidgets>
<images>
<image name="image0">
<data format="XPM.GZ" length="2926">789c9d95594f32591086effd15c4ba3393fae895ee4ce6824540141011b7c95cf406a202caa6f065fefb549faaea0b24996fc623cb937aeb3d55754e871f67a587eb6ee9ecc7c96a1dada74929798e96a5b374339bedfefceb8f9f27a7b65da27fcb724bf6e96f27a783752929f516f32c070402289b3fc39d8203c3136157e276c1260eac0f0ade0907927f2d9c58261f929cad72be0cef8535ff5959e277c201ef0fa02cf1ae7022f9efca12ff301ca81e87c21a5f32db5acf95b0eebfcdd92e2be3a5b0fa7986435bfd6e981d99278c0ae6795c288b3e2b98e3036157d8f839961308af985df51b1b0e9dc0098ddf5a3811fd7dceaee52a370d475e28f9b7ca1c07539f67173c144e65be2fcae2d763f62d89df2acb7cc282393e57b6b9ff58d893fca632c7d1ccc78bbcd48b4c7cc2ec4bfdf0aa2cfbf50be6fa2c65d9af2aacfd2c94e53cccf9fa7645eb7794a59ebdb027fe5565895f09cb7e981a267f9febaf3117fab6702af599e7a5e2049e6dce1377c25affa6608e4786e34a58894dfc8b59f5f890731087e28f2de648fbdb16ccfd6c9465bf7365c732f12f61ed3f5016fd4a59f4e6790fddd00a5d137f638eb4bfa532df5ffc148ea4be5ac17c5ea9b2ecd72b98efff403893fa1accb12d5c5696fd4d7f6152c41f95c53f2a98f56b6597fbf3857da9b75e30fb5584b59fa78239de5596fd3e0be6fdccf311b99115f1fcdaccb12fe77927ac7e2365f1c382793e63e14cfccdf3132571e69b1f07e83327d23fbac2bee4d785d57f2a9c89de9c6fecaa1fce98135bf845b9e2189e2a07e6fee287b0cfcf3bce9525ff5d38927a1bcca9cc1b66ca528ff93d89d338e3f9e182b9c86f31a752ff609d2f847f5f83b5ea31c218137a4f8fac0cc738e10cd6d3b7189f718a2ff88a6f38c339ad05adfcf31d3f7089ab037d42ea356e708b9ff8853bdc6395de6b58c706ad736c1ee823f2de608b146dbcc08e8976f012afb04b3975ec1de853aa2457f749d5c16b1ce00d0ecdf75b1ce1dd11fd1b55d236cef7f8808ff88465b4d02676d03da29f51dd9e513fa28f150c3004246d07002288bfe9e7d45f0712f22635a490d15ef730361e3b389c67aedf2390ea3157e73dc333e9a6f042d13ebc7ed32f6882405d3ee1c678030ee10d6630a76f162c8ee8f37adeb14c0aaa0b3e68b725ac80a2b039a29f630db6e46bc127d5fd45de4b5226b0833d8ea07a445f871ae96dacc218ead08073c835136842eba8be016db830e77a419f21aca143f76c025b9ae7e5813ea35bd5a0731fd1c4877a7f614fde57d085deb7f31ad31dccf54fd087883ab7a88f6baabb45fdf760003707fa09ddd826f66048af1826f00a0bb3aa7009b73082bb03fd2faeffa7fff58cfffcbcfffdfbc93f7f7d62d7</data>
<data format="XPM.GZ" length="4462">789c9d97c76e24490e86effd1442f3d65870d2451a0ce6206f5adeb4cc620f8c34f2553225b5a4c1befb46927fe6a1d4c0ccac4287fa8a0c26834193f5dbb785b3fd9d856fbf7d799ec9ecba5ea8afe469e15bf3727ffffeeffffcf1e797af49b2d0ffc7d142f2f55f5fbe1ecc16ea85dde9a4ed81290045faa77ca49cf4ab67ba1e3953969173651ab9d4fdf1c8a27c3872ad7c3c72d3b32c2a67c3f3444636fbef23eb7e590267e68fcc4656395d8dacf6d938ef97eaef289781cddebdb2846fccff44b989ba58e3411f3dc75158e6df1d3889539517ca49bf54fe43398d1dec4f46567f685fd9c539f43fc025f80c1c3ce8d93f28e77185f8bf0c6cfae4c0b5f9c3c6e5c0542a4b5876fe13708df39d2bd7716372aa8c93c4e4723bb2f977aadc26ceec4bdb7310e6b0bfab9c2445ecd49f1370694cebca65d260ffa6711a41aef14d24e94cee6be3348e0ae5e9c8765f07ca3e8db17f0f9c825794eb3489351fe9bb7217e4969f29388bd51ee9fda5715a19730696b852fea95c6471647ca95cf64bcf43e0cef4657b647bfe6acf213d6bb32f9a9f5992b5a64f9a8f990b6cf9ecc15d6cf9acf6b2da55a8a75cb973dee4b2d1b38b5c05de02434e87e01aacfb351df5bebddea74b5c67f9c795711ea15e357e2ecde358fb87efc0a867df8cac728a074e62e527706afb59f3cf6583be5c28bb3c35f693812d1fbdc6dbe57966fec932d899ffa4f7e38adca17e34beaeca4b9c271a18f1d5fc739257b0d70d9c68be7bed7fcee7827ab91cd8e4740cf6b19d4ffb87ab07b9bf516e72d4a3ac821b9cef6e60d84f47367ded2fae1d9f7704f6163f79000ffde27660f387ed3c5dbf54dfeebb0bf6acbe6b706bfa5ef32f8f8b18f5bf0f463f20edb77956a4e68fbc80b3c4facd163847be6bfde72ec86dbeac82715fbc0286be683cf3bc081d44f7df80d344fb0b6b7de64581fb916765297263d6fccd9b7ee97e566e8b06cfdb1f59cf2bda2f8bbc2c11df0c5c41aefdb328ca22b1feb0012eedbce24736f91b18fb796d64eb87cb60817dcdafb07d906bfd14d22f659d8785ef97b2f6d7b2df6ef1d6fb2babaac6f92e8c25b27ecc1f239b7f3a5fca5a8678ea7c2d9bc0e6ef1238b3fca2c7814d5f4cbf9334b5f833384bed3c7a5f5514f4adbe2ec07962e7590457f06f6f649b977afe2a16f42f5e070bfc591e18f7a5f1a812a9e0df39d827da4fbd8c6ccfd7785569bf945f953371a9d5a3de67950bfa2d75c63eb2fb15bdcfaaf011e6c7263846bf8f4636f91618f3c7d3c0f047fb69550efab2074e12bd6fd27957553ec33c5b043bcc7f9d0795f818fdb501a3df8ae673e507ff69021eea37063bc45ffb73550736ff36c0a84f3e0317a86f8b5f139e6ffe1f821de6d9127898ff3be00a7c3ab2cd03e3d697560ff40016e47b3bb2e96bbd559d8f32bbff4b7065f193042c98873acf240af6adbf3c83c5f2954bb0c7bcd77c107d81d2fdebc63e33ff640aaecc9e1c8151df5c803dfaadc64b52dfa03ed64636ffb4ff4b2867f453ede7227586fcd3f9264ded91fffafe236d5da37fe83c91ceb7b9e5b7f6731ff92ed7f747d6fbf7e185cf58347e3e6932e47b3430fa893edf87d795c2fc3f003b67f5f902cec17abfde0dfa3c053b3c5ffb832fc2eb8fddcf233887fc195c801f46b6f3cdc02558fba72f7d2d1a7f7e321ee58fe0cad86bbff24dd3e2fe74fef836b0c6eb60d62fa6bf5e07b3419f853dd7dc70fb8bd5f1255fd90ed30f9f3c5ff30ddff21ddff384a7fcc08ffcc4cf61cdf8855ff9e79c7e1db4dff89d3f7891977899577895d7789d377893b7f83b6fcfe937bc13b477798ff7f9800ff928ac633ee11f7cca6761d7f99c7e1b3cb908da11c7413be1943376e153cc39175c72f549ff9e17c31744429e6a6aa8a58e2ee98aaee9866e7f617fc24b7417a4f734a1293dd0233dd133cd8285177aa5f9f3b63ca5377aa78f607b919668995682e62aadd17ab0b1419b9ff41f682b48bed336edd02eed05ed7d5ea3033a0cdf1ed1f127fd273ae123fa41a774a6b685cee982228a837e42e927fd47caf8985c38651eb40b2ac38e4a5842658a97fab33fd248cb87d2c9a55cc9b5dcc82d1fc99ddccb44a6f230af2f8ff224cf417f262ff22a3fe54ddee543166549966545567f617f4dd66523dc6b2c9bb225df655b7682f692ecca9eeccfe97772c09b722847722c27c1f3eb70f66bf9116c9fca999ccbc59cfe25bf4a143a5ef8992561324a78bd92522acf9ebc78efe7cf7b153276db37bef59dbff457fedadff85b7f27abfede4ffcd4cf9ff76faeff4fffefeff8c7f5fedfdfbffc0fa355c495</data>
</image>
</images>
<tabstops>
......
......@@ -332,6 +332,7 @@ void ScriptBuilder::initViewOptions() {
new QListViewItem( opsSkymap, "AnimateSlewing", i18n( "Use animated slewing? (otherwise, \"snap\" to new focus)" ), i18n( "bool" ) );
new QListViewItem( opsSkymap, "UseRefraction", i18n( "Correct for atmospheric refraction?" ), i18n( "bool" ) );
new QListViewItem( opsSkymap, "UseAutoLabel", i18n( "Automatically attach name label to centered object?" ), i18n( "bool" ) );
new QListViewItem( opsSkymap, "UseHoverLabel", i18n( "Attach temporary name label when hovering mouse on an object?" ), i18n( "bool" ) );
new QListViewItem( opsSkymap, "UseAutoTrail", i18n( "Automatically add trail to centered solar system body?" ), i18n( "bool" ) );
new QListViewItem( opsSkymap, "FadePlanetTrails", i18n( "Planet trails fade to sky color? (otherwise color is constant)" ), i18n( "bool" ) );
argChangeViewOption->OptionName->insertItem( "UseAltAz" );
......@@ -342,6 +343,7 @@ void ScriptBuilder::initViewOptions() {
argChangeViewOption->OptionName->insertItem( "FOVColor" );
argChangeViewOption->OptionName->insertItem( "UseRefraction" );
argChangeViewOption->OptionName->insertItem( "UseAutoLabel" );
argChangeViewOption->OptionName->insertItem( "UseHoverLabel" );
argChangeViewOption->OptionName->insertItem( "UseAutoTrail" );
argChangeViewOption->OptionName->insertItem( "AnimateSlewing" );
argChangeViewOption->OptionName->insertItem( "FadePlanetTrails" );
......
......@@ -474,8 +474,9 @@ void SkyMap::slotTransientTimeout( void ) {
TransientTimer.stop();
} else {
TransientColor.setRgb( newRed, newGreen, newBlue );
update();
}
update();
}
void SkyMap::slotCenter( void ) {
......
......@@ -65,6 +65,15 @@ void SkyMap::drawZoomBox( QPainter &p ) {
void SkyMap::drawTransientLabel( QPainter &p ) {
if ( transientObject() ) {
p.setPen( TransientColor );
QFont stdFont( p.font() );
QFont smallFont( stdFont );
smallFont.setPointSize( stdFont.pointSize() - 2 );
if ( zoomFactor() < 10.*MINZOOM ) {
p.setFont( smallFont );
} else {
p.setFont( stdFont );
}
if ( checkVisibility( transientObject(), fov(), XRange ) ) {
QPoint o = getXY( transientObject(), data->options->useAltAz, data->options->useRefraction, 1.0 );
......@@ -72,6 +81,9 @@ void SkyMap::drawTransientLabel( QPainter &p ) {
drawNameLabel( p, transientObject(), o.x(), o.y(), 1.0 );
}
}
//reset font
p.setFont( stdFont );
}
}
......
......@@ -247,6 +247,7 @@ ViewOpsDialog::ViewOpsDialog( QWidget *parent )
adv->useRefraction->setChecked( ksw->options()->useRefraction );
adv->animateSlewing->setChecked( ksw->options()->useAnimatedSlewing );
adv->autoLabel->setChecked( ksw->options()->useAutoLabel );
adv->hoverLabel->setChecked( ksw->options()->useHoverLabel );
adv->hideObjects->setChecked( ksw->options()->hideOnSlew );
adv->hideSpinBox->tsbox()->changeScale( (float)ksw->options()->slewTimeScale );
......@@ -344,6 +345,7 @@ ViewOpsDialog::ViewOpsDialog( QWidget *parent )
connect( adv->useRefraction, SIGNAL( clicked() ), this, SLOT( updateDisplay() ) );
connect( adv->animateSlewing, SIGNAL( clicked() ), this, SLOT( updateDisplay() ) );
connect( adv->autoLabel, SIGNAL( clicked() ), this, SLOT( updateDisplay() ) );
connect( adv->hoverLabel, SIGNAL( clicked() ), this, SLOT( updateDisplay() ) );
connect( adv->hideSpinBox, SIGNAL( scaleChanged( float ) ), this, SLOT( changeSlewTimeScale( float ) ) );
connect( adv->hideObjects, SIGNAL( clicked() ), this, SLOT( updateDisplay() ) );
connect( adv->hideStars, SIGNAL( clicked() ), this, SLOT( updateDisplay() ) );
......@@ -651,6 +653,7 @@ void ViewOpsDialog::updateDisplay( void ) {
ksw->options()->useRefraction = adv->useRefraction->isChecked();
ksw->options()->useAnimatedSlewing = adv->animateSlewing->isChecked();
ksw->options()->useAutoLabel = adv->autoLabel->isChecked();
ksw->options()->useHoverLabel = adv->hoverLabel->isChecked();
ksw->options()->hideOnSlew = adv->hideObjects->isChecked();
ksw->options()->hideStars = adv->hideStars->isChecked();
ksw->options()->hidePlanets = adv->hidePlanets->isChecked();
......
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