Skip to content

Commit

Permalink
Cleaned up and resized all toolbar iconography. They are all now outl…
Browse files Browse the repository at this point in the history
…ine icons instead of a mix-and-match. Prefs and help toolbar buttons now functional.
  • Loading branch information
bluescan committed Oct 12, 2020
1 parent 5ec82fb commit 01493c7
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Contrib/imgui/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ ImGuiStyle::ImGuiStyle()
Alpha = 1.0f; // Global alpha applies to everything in ImGui
WindowPadding = ImVec2(8,8); // Padding within a window
WindowRounding = 4.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested.
WindowBorderSize = 0.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested.
WindowMinSize = ImVec2(32,32); // Minimum window size
WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text
WindowMenuButtonPosition= ImGuiDir_Left; // Position of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left.
Expand All @@ -973,7 +973,7 @@ ImGuiStyle::ImGuiStyle()
FramePadding = ImVec2(6,3); // Padding within a framed rectangle (used by most widgets)
FrameRounding = 3.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
FrameBorderSize = 1.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
ItemSpacing = ImVec2(12,2); // Horizontal and vertical spacing between widgets/lines
ItemSpacing = ImVec2(10,2); // Horizontal and vertical spacing between widgets/lines
ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
Expand Down
Binary file modified Data/Crop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/PropEdit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/RotACW.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/RotCW.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/Screenshot_Toolbar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Src/Dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ void Viewer::ShowAboutPopup(bool* popen)
glfwGetVersion(&glfwMajor, &glfwMinor, &glfwRev);
ImGui::Text("Tacent View V %d.%d.%d by Tristan Grimmer", ViewerVersion::Major, ViewerVersion::Minor, ViewerVersion::Revision);
ImGui::Separator();
ImGui::Text("The following amazing and liberally licensed frameworks are used by this tool.");
ImGui::Text("Dear ImGui V %s", IMGUI_VERSION);
ImGui::Text("GLAD V %s", glad_glGetString(GL_VERSION));
ImGui::Text("GLFW V %d.%d.%d", glfwMajor, glfwMinor, glfwRev);
Expand Down
71 changes: 36 additions & 35 deletions Src/TacentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ namespace Viewer
const tVector4 ColourEnabledTint = tVector4(1.00f, 1.00f, 1.00f, 1.00f);
const tVector4 ColourDisabledTint = tVector4(0.36f, 0.36f, 0.48f, 1.00f);
const tVector4 ColourBG = tVector4(0.00f, 0.00f, 0.00f, 0.00f);
const tVector4 ColourPressedBG = tVector4(0.26f, 0.59f, 0.98f, 1.00f);
const tVector4 ColourPressedBG = tVector4(0.00f, 0.75f, 0.05f, 1.00f);
const tVector4 ColourClear = tVector4(0.10f, 0.10f, 0.12f, 1.00f);

const int MenuBarHeight = 30;
const float ZoomMin = 10.0f;
const float ZoomMax = 2500.0f;
uint64 FrameNumber = 0;
tVector2 ToolImageSize (24.0f, 24.0f);

void DrawBackground(float bgX, float bgY, float bgW, float bgH);
void DrawNavBar(float x, float y, float w, float h);
Expand Down Expand Up @@ -787,7 +789,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
glClearColor(ColourClear.x, ColourClear.y, ColourClear.z, ColourClear.w);
glClear(GL_COLOR_BUFFER_BIT);
int bottomUIHeight = GetNavBarHeight();
int topUIHeight = (FullscreenMode || !Config.ShowMenuBar) ? 0 : 26;
int topUIHeight = (FullscreenMode || !Config.ShowMenuBar) ? 0 : MenuBarHeight;

ImGui_ImplOpenGL2_NewFrame();
ImGui_ImplGlfw_NewFrame();
Expand Down Expand Up @@ -1056,7 +1058,6 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)

if (SlideshowPlaying && (Config.SlidehowFrameDuration >= 1.0f) && Config.SlideshowProgressArc)
{

ImGui::SetNextWindowPos(tVector2((workAreaW>>1)-22.0f+7.0f, float(topUIHeight) + float(workAreaH) - 64.0f));
ImGui::Begin("SlideProgress", nullptr, flagsImgButton | ImGuiWindowFlags_NoInputs);
ImGui::SetCursorPos(tVector2(15, 14));
Expand Down Expand Up @@ -1176,7 +1177,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)

if (!FullscreenMode && Config.ShowMenuBar)
{
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, tVector2(4,6));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, tVector2(4,8));
ImGui::BeginMainMenuBar();

//
Expand Down Expand Up @@ -1371,8 +1372,8 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
tColourf floatCol(PixelColour);
tVector4 colV4(floatCol.R, floatCol.G, floatCol.B, floatCol.A);
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 6.0f);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 3.0f);
if (ImGui::ColorButton("Colour##2f", colV4, ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel, tVector2(20,20)))
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 2.0f);
if (ImGui::ColorButton("Colour##2f", colV4, ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel, tVector2(26,26)))
ImGui::OpenPopup("CopyColourAs");

if (ImGui::BeginPopup("CopyColourAs"))
Expand All @@ -1381,7 +1382,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
bool transAvail = CurrImage ? !CurrImage->IsAltPictureEnabled() : false;
if (ImGui::ImageButton
(
ImTextureID(FlipVImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2, ColourBG,
ImTextureID(FlipVImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1, ColourBG,
transAvail ? ColourEnabledTint : ColourDisabledTint) && transAvail
)
{
Expand All @@ -1394,7 +1395,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)

if (ImGui::ImageButton
(
ImTextureID(FlipHImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2, ColourBG,
ImTextureID(FlipHImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1, ColourBG,
transAvail ? ColourEnabledTint : ColourDisabledTint) && transAvail
)
{
Expand All @@ -1407,7 +1408,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)

if (ImGui::ImageButton
(
ImTextureID(RotateACWImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2, ColourBG,
ImTextureID(RotateACWImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1, ColourBG,
transAvail ? ColourEnabledTint : ColourDisabledTint) && transAvail
)
{
Expand All @@ -1420,7 +1421,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)

if (ImGui::ImageButton
(
ImTextureID(RotateCWImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2, ColourBG,
ImTextureID(RotateCWImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1, ColourBG,
transAvail ? ColourEnabledTint : ColourDisabledTint) && transAvail
)
{
Expand All @@ -1434,7 +1435,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
bool cropAvail = CurrImage && transAvail && !Config.Tile;
if (ImGui::ImageButton
(
ImTextureID(CropImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(CropImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
CropMode ? ColourPressedBG : ColourBG, cropAvail ? ColourEnabledTint : ColourDisabledTint) && cropAvail
) CropMode = !CropMode;
ShowToolTip("Crop");
Expand All @@ -1443,7 +1444,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
bool altMipmapsPicEnabl = altMipmapsPicAvail && CurrImage->IsAltPictureEnabled();
if (ImGui::ImageButton
(
ImTextureID(MipmapsImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(MipmapsImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
altMipmapsPicEnabl ? ColourPressedBG : ColourBG, altMipmapsPicAvail ? ColourEnabledTint : ColourDisabledTint) && altMipmapsPicAvail
)
{
Expand All @@ -1456,7 +1457,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
bool altCubemapPicEnabl = altCubemapPicAvail && CurrImage->IsAltPictureEnabled();
if (ImGui::ImageButton
(
ImTextureID(CubemapImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(CubemapImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
altCubemapPicEnabl ? ColourPressedBG : ColourBG, altCubemapPicAvail ? ColourEnabledTint : ColourDisabledTint) && altCubemapPicAvail
)
{
Expand All @@ -1468,7 +1469,7 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
bool tileAvail = CurrImage ? !CropMode : false;
if (ImGui::ImageButton
(
ImTextureID(TileImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(TileImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
Config.Tile ? ColourPressedBG : ColourBG, tileAvail ? ColourEnabledTint : ColourDisabledTint) && tileAvail
)
{
Expand All @@ -1478,60 +1479,60 @@ void Viewer::Update(GLFWwindow* window, double dt, bool dopoll)
}
ShowToolTip("Show Images Tiled");

bool refreshAvail = CurrImage ? true : false;
if (ImGui::ImageButton
(
ImTextureID(RefreshImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ColourBG, refreshAvail ? ColourEnabledTint : ColourDisabledTint) && refreshAvail
)
{
CurrImage->Unbind();
CurrImage->Unload(true);
CurrImage->Load();
CurrImage->Bind();
SetWindowTitle();
}
ShowToolTip("Refresh/Reload Current File");

bool recycleAvail = CurrImage ? true : false;
if (ImGui::ImageButton
(
ImTextureID(RecycleImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(RecycleImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
ColourBG, recycleAvail ? ColourEnabledTint : ColourDisabledTint) && recycleAvail
) Request_DeleteFileModal = true;
ShowToolTip("Delete Current File");

if (ImGui::ImageButton
(
ImTextureID(ContentViewImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(ContentViewImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
Config.ContentViewShow ? ColourPressedBG : ColourBG, ColourEnabledTint)
) Config.ContentViewShow = !Config.ContentViewShow;
ShowToolTip("Content Thumbnail View");

if (ImGui::ImageButton
(
ImTextureID(PropEditImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(PropEditImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
PropEditorWindow ? ColourPressedBG : ColourBG, ColourEnabledTint)
) PropEditorWindow = !PropEditorWindow;
ShowToolTip("Image Property Editor");

bool refreshAvail = CurrImage ? true : false;
if (ImGui::ImageButton
(
ImTextureID(RefreshImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
ColourBG, refreshAvail ? ColourEnabledTint : ColourDisabledTint) && refreshAvail
)
{
CurrImage->Unbind();
CurrImage->Unload(true);
CurrImage->Load();
CurrImage->Bind();
SetWindowTitle();
}
ShowToolTip("Refresh/Reload Current File");

if (ImGui::ImageButton
(
ImTextureID(InfoOverlayImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(InfoOverlayImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
Config.ShowImageDetails ? ColourPressedBG : ColourBG, ColourEnabledTint)
) Config.ShowImageDetails = !Config.ShowImageDetails;
ShowToolTip("Information Overlay");

if (ImGui::ImageButton
(
ImTextureID(HelpImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(HelpImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
ShowCheatSheet ? ColourPressedBG : ColourBG, ColourEnabledTint)
) ShowCheatSheet = !ShowCheatSheet;
ShowToolTip("Help");

if (ImGui::ImageButton
(
ImTextureID(PrefsImage.Bind()), tVector2(17, 17), tVector2(0, 1), tVector2(1, 0), 2,
ImTextureID(PrefsImage.Bind()), ToolImageSize, tVector2(0, 1), tVector2(1, 0), 1,
PrefsWindow ? ColourPressedBG : ColourBG, ColourEnabledTint)
) PrefsWindow = !PrefsWindow;
ShowToolTip("Preferences");
Expand Down

0 comments on commit 01493c7

Please sign in to comment.