Skip to content
Browse files

Added --hide root option to not draw branches from the root directory.

  • Loading branch information...
1 parent d9f99a7 commit 5627a38bfc400a6ff9947661f9ecb7760aaad524 @acaudwell committed Apr 5, 2011
Showing with 21 additions and 9 deletions.
  1. +1 −0 ChangeLog
  2. +1 −0 README
  3. +1 −0 data/gource.1
  4. +4 −4 src/dirnode.cpp
  5. +4 −0 src/gource.cpp
  6. +9 −5 src/gource_settings.cpp
  7. +1 −0 src/gource_settings.h
View
1 ChangeLog
@@ -1,4 +1,5 @@
0.33:
+ * Added --hide root option to not draw branches from the root directory.
* Fixed log parsing of Bazaar merges and tagged commits.
* --output-custom-log now skips unparsed log entries instead of exiting.
View
1 README
@@ -210,6 +210,7 @@ options:
filenames - names of files
mouse - mouse cursor
progress - progress bar widget
+ root - root directory of tree
tree - animated tree structure
users - user avatars
usernames - names of users
View
1 data/gource.1
@@ -176,6 +176,7 @@ Hide one or more display elements from the list below:
filenames \- names of files
mouse \- mouse cursor
progress \- progress bar widget
+ root \- root directory of the tree
tree \- animated tree structure
users \- user avatars
usernames \- names of users
View
8 src/dirnode.cpp
@@ -1039,8 +1039,8 @@ void RDirNode::calcProjectedPos() {
void RDirNode::drawEdgeShadows(float dt) const{
- spline.drawShadow();
-
+ if(parent!=0 && (!gGourceSettings.hide_root || parent->parent !=0)) spline.drawShadow();
+
for(std::list<RDirNode*>::const_iterator it = children.begin(); it != children.end(); it++) {
RDirNode* child = (*it);
@@ -1053,8 +1053,8 @@ void RDirNode::drawEdgeShadows(float dt) const{
void RDirNode::drawEdges(float dt) const{
- spline.draw();
-
+ if(parent!=0 && (!gGourceSettings.hide_root || parent->parent !=0)) spline.draw();
+
for(std::list<RDirNode*>::const_iterator it = children.begin(); it != children.end(); it++) {
RDirNode* child = (*it);
View
4 src/gource.cpp
@@ -766,6 +766,10 @@ void Gource::keyPress(SDL_KeyboardEvent *e) {
}
}
+ if (e->keysym.sym == SDLK_r) {
+ gGourceSettings.hide_root = !gGourceSettings.hide_root;
+ }
+
if (e->keysym.sym == SDLK_k) {
gGourceSettings.show_key = !gGourceSettings.show_key;
}
View
14 src/gource_settings.cpp
@@ -100,7 +100,7 @@ if(extended_help) {
printf(" --git-branch Get the git log of a particular branch\n\n");
printf(" --hide DISPLAY_ELEMENT bloom,date,dirnames,files,filenames,mouse,progress,\n");
- printf(" tree,users,usernames\n\n");
+ printf(" root,tree,users,usernames\n\n");
printf(" --logo IMAGE Logo to display in the foreground\n");
printf(" --logo-offset XxY Offset position of the logo\n\n");
@@ -201,6 +201,7 @@ GourceSettings::GourceSettings() {
arg_types["hide-progress"] = "bool";
arg_types["hide-bloom"] = "bool";
arg_types["hide-mouse"] = "bool";
+ arg_types["hide-root"] = "bool";
arg_types["highlight-all-users"] = "bool";
arg_types["highlight-dirs"] = "bool";
arg_types["file-extensions"] = "bool";
@@ -278,9 +279,10 @@ void GourceSettings::setGourceDefaults() {
hide_usernames = false;
hide_filenames = false;
hide_dirnames = false;
- hide_progress = false;
- hide_bloom = false;
- hide_mouse = false;
+ hide_progress = false;
+ hide_bloom = false;
+ hide_mouse = false;
+ hide_root = false;
start_position = 0.0f;
stop_position = 0.0f;
@@ -484,7 +486,8 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc
&& hide_field != "dirnames"
&& hide_field != "bloom"
&& hide_field != "progress"
- && hide_field != "mouse") {
+ && hide_field != "mouse"
+ && hide_field != "root") {
std::string unknown_hide_option = std::string("unknown option hide ") + hide_field;
conffile.entryException(entry, unknown_hide_option);
}
@@ -516,6 +519,7 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc
else if(hidestr == "dirnames") hide_dirnames = true;
else if(hidestr == "bloom") hide_bloom = true;
else if(hidestr == "progress") hide_progress = true;
+ else if(hidestr == "root") hide_root = true;
else if(hidestr == "mouse") {
hide_mouse = true;
hide_progress = true;
View
1 src/gource_settings.h
@@ -48,6 +48,7 @@ class GourceSettings : public SDLAppSettings {
bool hide_progress;
bool hide_bloom;
bool hide_mouse;
+ bool hide_root;
bool disable_auto_rotate;

0 comments on commit 5627a38

Please sign in to comment.
Something went wrong with that request. Please try again.