140 bool is_multi_selected =
147 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.3f, 0.5f, 0.8f, 0.3f));
148 }
else if (is_multi_selected) {
149 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.5f, 0.5f, 0.2f, 0.3f));
152 ImGui::BeginChild(absl::StrFormat(
"##Sheet%02X", sheet_id).c_str(),
153 ImVec2(thumb_width + 8, thumb_height + 24),
true,
154 ImGuiWindowFlags_NoScrollbar);
157 preview_opts.
canvas_size = ImVec2(thumb_width + 1, thumb_height + 1);
158 preview_opts.
dest_pos = ImVec2(2, 2);
159 preview_opts.
dest_size = ImVec2(thumb_width - 2, thumb_height - 2);
177 std::string label = absl::StrFormat(
"%02X", sheet_id);
183 ImVec2 text_pos = ImGui::GetCursorScreenPos();
184 ImVec2 text_size = ImGui::CalcTextSize(label.c_str());
186 ImVec2(2, 2), ImVec2(text_size.x + 4, text_size.y + 2),
187 is_modified ? IM_COL32(180, 100, 0, 200) : IM_COL32(0, 100, 0, 180));
190 is_modified ? IM_COL32(255, 200, 100, 255)
191 : IM_COL32(150, 255, 150, 255));
196 if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
197 if (ImGui::GetIO().KeyCtrl) {
199 if (is_multi_selected) {
211 if (ImGui::IsItemHovered() &&
212 ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
218 if (is_selected || is_multi_selected) {
219 ImGui::PopStyleColor();
223 if (ImGui::IsItemHovered()) {
224 ImGui::BeginTooltip();
225 ImGui::Text(
"Sheet: 0x%02X (%d)", sheet_id, sheet_id);
227 ImGui::Text(
"Size: %dx%d", bitmap.
width(), bitmap.
height());
228 ImGui::Text(
"Depth: %d bpp", bitmap.
depth());
230 ImGui::Text(
"(Inactive)");
233 ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.2f, 1.0f),
"Modified");