Skip to content

Commit

Permalink
Added --hide root option to not draw branches from the root directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
acaudwell committed Apr 18, 2011
1 parent d9f99a7 commit 5627a38
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions 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.

Expand Down
1 change: 1 addition & 0 deletions README
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions data/gource.1
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/dirnode.cpp
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
4 changes: 4 additions & 0 deletions src/gource.cpp
Expand Up @@ -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;
}
Expand Down
14 changes: 9 additions & 5 deletions src/gource_settings.cpp
Expand Up @@ -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");
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/gource_settings.h
Expand Up @@ -48,6 +48,7 @@ class GourceSettings : public SDLAppSettings {
bool hide_progress;
bool hide_bloom;
bool hide_mouse;
bool hide_root;

bool disable_auto_rotate;

Expand Down

0 comments on commit 5627a38

Please sign in to comment.