137 bool is_multi_selected =
144 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.3f, 0.5f, 0.8f, 0.3f));
145 }
else if (is_multi_selected) {
146 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.5f, 0.5f, 0.2f, 0.3f));
149 ImGui::BeginChild(absl::StrFormat(
"##Sheet%02X", sheet_id).c_str(),
150 ImVec2(thumb_width + 8, thumb_height + 24),
true,
151 ImGuiWindowFlags_NoScrollbar);
154 preview_opts.
canvas_size = ImVec2(thumb_width + 1, thumb_height + 1);
155 preview_opts.
dest_pos = ImVec2(2, 2);
156 preview_opts.
dest_size = ImVec2(thumb_width - 2, thumb_height - 2);
174 std::string label = absl::StrFormat(
"%02X", sheet_id);
180 ImVec2 text_pos = ImGui::GetCursorScreenPos();
181 ImVec2 text_size = ImGui::CalcTextSize(label.c_str());
183 ImVec2(2, 2), ImVec2(text_size.x + 4, text_size.y + 2),
184 is_modified ? IM_COL32(180, 100, 0, 200) : IM_COL32(0, 100, 0, 180));
187 is_modified ? IM_COL32(255, 200, 100, 255)
188 : IM_COL32(150, 255, 150, 255));
193 if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
194 if (ImGui::GetIO().KeyCtrl) {
196 if (is_multi_selected) {
208 if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
214 if (is_selected || is_multi_selected) {
215 ImGui::PopStyleColor();
219 if (ImGui::IsItemHovered()) {
220 ImGui::BeginTooltip();
221 ImGui::Text(
"Sheet: 0x%02X (%d)", sheet_id, sheet_id);
223 ImGui::Text(
"Size: %dx%d", bitmap.
width(), bitmap.
height());
224 ImGui::Text(
"Depth: %d bpp", bitmap.
depth());
226 ImGui::Text(
"(Inactive)");
229 ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.2f, 1.0f),
"Modified");