# HG changeset patch # User Santeri Piippo # Date 1382467160 -10800 # Node ID f9476dbd87ec1bf28ec3cfa38d385b06c54d4717 # Parent c294b2070185aa412e1ba339122101b6b0dcd4e2 - Added new actions "Hide" and "Reveal" which allow direct setting of objects' visibility setting instead of toggling it. diff -r c294b2070185 -r f9476dbd87ec changelog.txt --- a/changelog.txt Tue Oct 22 21:03:57 2013 +0300 +++ b/changelog.txt Tue Oct 22 21:39:20 2013 +0300 @@ -22,6 +22,8 @@ gives the opportunity to see the other config fields) - Added new action "Add History Line" for quickly inserting 0 !HISTORY lines to headers - Added new action "Go to line", default shortcut Ctrl-G. It should be obvious what it does. +- Added new actions "Hide" and "Reveal" which allow direct setting of objects' visibility setting instead of + toggling it. - Added support for logoed studs, this should satisfy Steffen. :p - Added support for '0 BFC CLIP' and '0 BFC NOCLIP' and added auto-correction from errorneous MLCAD syntax ('0 BFC CERTIFY CLIP'). diff -r c294b2070185 -r f9476dbd87ec icons/visibility-show.png Binary file icons/visibility-show.png has changed diff -r c294b2070185 -r f9476dbd87ec icons/visibility.png Binary file icons/visibility.png has changed diff -r c294b2070185 -r f9476dbd87ec ldforge.qrc --- a/ldforge.qrc Tue Oct 22 21:03:57 2013 +0300 +++ b/ldforge.qrc Tue Oct 22 21:39:20 2013 +0300 @@ -99,7 +99,9 @@ ./icons/uncolorize.png ./icons/undo.png ./icons/vertex.png - ./icons/visibility.png + ./icons/visibility-hide.png + ./icons/visibility-show.png + ./icons/visibility-toggle.png ./icons/wireframe.png ./icons/ytruder.png data/primitive-categories.cfg diff -r c294b2070185 -r f9476dbd87ec src/actions.h --- a/src/actions.h Tue Oct 22 21:03:57 2013 +0300 +++ b/src/actions.h Tue Oct 22 21:39:20 2013 +0300 @@ -72,7 +72,9 @@ act (Borders) act (CornerVerts) act (RoundCoordinates) -act (Visibility) +act (VisibilityHide) +act (VisibilityReveal) +act (VisibilityToggle) act (ReplaceCoords) act (Flip) act (Demote) diff -r c294b2070185 -r f9476dbd87ec src/gui.cpp --- a/src/gui.cpp Tue Oct 22 21:03:57 2013 +0300 +++ b/src/gui.cpp Tue Oct 22 21:39:20 2013 +0300 @@ -345,12 +345,15 @@ } break; } - // Put it into brackets if it's hidden - if (obj->hidden()) - descr = fmt ("[[ %1 ]]", descr); - QListWidgetItem* item = new QListWidgetItem (descr); item->setIcon (getIcon (obj->typeName())); + + // Use italic font if hidden + if (obj->hidden()) + { QFont font = item->font(); + font.setItalic (true); + item->setFont (font); + } // Color gibberish orange on red so it stands out. if (obj->getType() == LDObject::Error) diff -r c294b2070185 -r f9476dbd87ec src/gui_actions.cpp --- a/src/gui_actions.cpp Tue Oct 22 21:03:57 2013 +0300 +++ b/src/gui_actions.cpp Tue Oct 22 21:39:20 2013 +0300 @@ -472,7 +472,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -DEFINE_ACTION (Visibility, 0) +DEFINE_ACTION (VisibilityToggle, 0) { for (LDObject* obj : selection()) obj->setHidden (!obj->hidden()); @@ -481,6 +481,24 @@ // ============================================================================= // ----------------------------------------------------------------------------- +DEFINE_ACTION (VisibilityHide, 0) +{ for (LDObject* obj : selection()) + obj->setHidden (true); + + g_win->refresh(); +} + +// ============================================================================= +// ----------------------------------------------------------------------------- +DEFINE_ACTION (VisibilityReveal, 0) +{ for (LDObject* obj : selection()) + obj->setHidden (false); + + g_win->refresh(); +} + +// ============================================================================= +// ----------------------------------------------------------------------------- DEFINE_ACTION (Wireframe, 0) { gl_wireframe = !gl_wireframe; g_win->R()->refresh(); diff -r c294b2070185 -r f9476dbd87ec ui/ldforge.ui --- a/ui/ldforge.ui Tue Oct 22 21:03:57 2013 +0300 +++ b/ui/ldforge.ui Tue Oct 22 21:39:20 2013 +0300 @@ -70,7 +70,7 @@ 0 0 900 - 26 + 24 @@ -182,10 +182,13 @@ - + + + + @@ -294,6 +297,7 @@ false + @@ -377,11 +381,15 @@ + + - + + + @@ -954,10 +962,10 @@ Round coordinates down to 3/4 decimals - + - :/icons/visibility.png:/icons/visibility.png + :/icons/visibility-toggle.png:/icons/visibility-toggle.png Toggle Visibility @@ -1291,6 +1299,30 @@ Circle Mode + + + + :/icons/visibility-hide.png:/icons/visibility-hide.png + + + Hide + + + Hides objects from view + + + + + + :/icons/visibility-show.png:/icons/visibility-show.png + + + Reveal + + + Reveals objects. Undoes hiding. + +