MCPcopy Create free account
hub / github.com/bluescan/tacentview / ShowPreferencesWindow

Method ShowPreferencesWindow

Src/Preferences.cpp:102–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102void Viewer::ShowPreferencesWindow(bool* popen)
103{
104 ImGuiWindowFlags windowFlags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar;
105
106 // We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only
107 // do it to make the Demo applications a little more welcoming.
108 tVector2 windowPos = Gutil::GetDialogOrigin(Gutil::DialogID::Preferences);
109 ImGui::SetNextWindowPos(windowPos, ImGuiCond_FirstUseEver);
110
111 tString title;
112 tsPrintf(title, "Preferences (%s Profile)", Config::GetProfileName());
113 if (!ImGui::Begin(title.Chr(), popen, windowFlags))
114 {
115 ImGui::End();
116 return;
117 }
118
119 Config::ProfileData& profile = Config::GetProfileData();
120 float buttonWidth = Gutil::GetUIParamScaled(100.0f, 2.5f);
121 float rightButtons = Gutil::GetUIParamExtent(169.0f, 437.0f);
122
123 bool tab = false;
124 uint32 category = Config::Category_None;
125 if (ImGui::BeginTabBar("PreferencesTabBar", ImGuiTabBarFlags_None))
126 {
127 tab = ImGui::BeginTabItem("Interface", nullptr, ImGuiTabItemFlags_NoTooltip);
128 if (tab)
129 {
130 category = Config::Category_Interface;
131 float itemWidth = Gutil::GetUIParamScaled(110.0f, 2.5f);
132 float presetColourComboWidth = Gutil::GetUIParamScaled(100.0f, 2.5f);
133 ImGui::NewLine();
134
135 ImGui::Checkbox("Always Show Filename", &profile.ShowNavFilenameAlways);
136 ImGui::SameLine();
137 Gutil::HelpMark
138 (
139 "When false the filename is only shown at the right of the nav-bar in\n"
140 "fullscreen mode because the window title-bar is not visible. When set\n"
141 "to true the filename is displayed there all the time."
142 );
143
144 ImGui::Checkbox("Transparent Work Area", &PendingTransparentWorkArea);
145 #ifndef PACKAGE_SNAP
146 if (PendingTransparentWorkArea != Config::Global.TransparentWorkArea)
147 {
148 ImGui::SameLine();
149 ImGui::Text("(Restart)");
150 }
151 #else
152 if (PendingTransparentWorkArea)
153 {
154 ImGui::SameLine();
155 ImGui::Text("(No Snap Support)");
156 }
157 #endif
158
159 ImGui::Checkbox("Background Extend", &profile.BackgroundExtend);

Callers

nothing calls this directly

Calls 8

ZoomModeEnumEnum · 0.85
GetBackgroundStyleMethod · 0.80
UnloadMethod · 0.80
GetFrameBufferBPCMethod · 0.80
SetMethod · 0.45
IsValidMethod · 0.45
LoadMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected