dded an action to quickly toggle BFC red/green view.

Sun, 07 Jul 2013 03:14:20 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 07 Jul 2013 03:14:20 +0300
changeset 353
07b3753baedc
parent 352
e8184f4e28f3
child 354
b32d4d66cb6e

dded an action to quickly toggle BFC red/green view.

changelog.txt file | annotate | diff | comparison | revisions
ldforge.qrc file | annotate | diff | comparison | revisions
mkqrc.sh file | annotate | diff | comparison | revisions
src/gui.cpp file | annotate | diff | comparison | revisions
src/gui_actions.cpp file | annotate | diff | comparison | revisions
--- a/changelog.txt	Sun Jul 07 03:04:40 2013 +0300
+++ b/changelog.txt	Sun Jul 07 03:14:20 2013 +0300
@@ -15,6 +15,7 @@
 - Replace coords: allow replacing all coords regardless of original value, plus relative moving (offset)
 - Objects can now be edited by double-clicking on them.
 - When drawing, drawn vertices now display coordinate labels.
+- Added an action to quickly toggle BFC red/green view.
 - Changed default keys for Y-axis moving from PgUp/PgDown to Home and End ala MLCAD.
 - [Linux] External programs can now be launched with Wine.
 - Improved external program fault handling: don't try to replace/append the output in case of failure, catch non-zero exit codes.
--- a/ldforge.qrc	Sun Jul 07 03:04:40 2013 +0300
+++ b/ldforge.qrc	Sun Jul 07 03:14:20 2013 +0300
@@ -17,6 +17,7 @@
 	<file>./icons/autocolor.png</file>
 	<file>./icons/axes.png</file>
 	<file>./icons/bfc.png</file>
+	<file>./icons/bfc-view.png</file>
 	<file>./icons/bomb.png</file>
 	<file>./icons/brick-new.png</file>
 	<file>./icons/brick.png</file>
--- a/mkqrc.sh	Sun Jul 07 03:04:40 2013 +0300
+++ b/mkqrc.sh	Sun Jul 07 03:14:20 2013 +0300
@@ -7,18 +7,6 @@
 
 printf "<!DOCTYPE RCC>\n<RCC version=\"1.0\">\n<qresource>\n" >> $QRCFILE
 
-# Make sure that whatever goes to QRC is added to the repo.
-# I keep forgetting to do this myself.
-for line in $(hg status $FILES |grep "?"); do
-	if [ "$line" != "?" ]; then
-		echo "hg add $line"
-		hg add $line;
-		
-		echo "pngout $line"
-		pngout $line
-	fi
-done
-
 for f in $FILES; do
 	printf "\t<file>$f</file>\n" >> $QRCFILE
 done
--- a/src/gui.cpp	Sun Jul 07 03:04:40 2013 +0300
+++ b/src/gui.cpp	Sun Jul 07 03:14:20 2013 +0300
@@ -61,6 +61,7 @@
 extern_cfg (str, gl_maincolor);
 extern_cfg (float, gl_maincolor_alpha);
 extern_cfg (bool, gl_wireframe);
+extern_cfg (bool, gl_colorbfc);
 
 const char* g_modeActionNames[] = {
 	"modeSelect",
@@ -148,6 +149,9 @@
 	findAction ("wireframe")->setCheckable (true);
 	findAction ("wireframe")->setChecked (gl_wireframe);
 	
+	findAction ("colorbfc")->setCheckable (true);
+	findAction ("colorbfc")->setChecked (gl_colorbfc);
+	
 	updateEditModeActions ();
 	
 	// things not implemented yet
@@ -202,6 +206,7 @@
 	addMenuAction ("resetView");
 	addMenuAction ("axes");
 	addMenuAction ("wireframe");
+	addMenuAction ("colorbfc");
 	menu->addSeparator ();
 	addMenuAction ("setOverlay");
 	addMenuAction ("clearOverlay");
@@ -406,6 +411,7 @@
 	initSingleToolBar ("View");
 	addToolBarAction ("axes");
 	addToolBarAction ("wireframe");
+	addToolBarAction ("colorbfc");
 	
 	// ==========================================
 	// Color toolbar
--- a/src/gui_actions.cpp	Sun Jul 07 03:04:40 2013 +0300
+++ b/src/gui_actions.cpp	Sun Jul 07 03:14:20 2013 +0300
@@ -38,6 +38,7 @@
 #include "widgets.h"
 
 extern_cfg (bool, gl_wireframe);
+extern_cfg( bool, gl_colorbfc );
 
 // =============================================================================
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -506,4 +507,11 @@
 
 MAKE_ACTION (reloadPrimitives, "Scan Primitives", "", "", (0)) {
 	PrimitiveLister::start ();
+}
+
+MAKE_ACTION( colorbfc, "BFC Red/Green View", "bfc-view", "", SHIFT( B ))
+{
+	gl_colorbfc = !gl_colorbfc;
+	ACTION( colorbfc )->setChecked( gl_colorbfc );
+	g_win->R ()->refresh();
 }
\ No newline at end of file

mercurial