Add color search feature

This commit is contained in:
GriffinR
2025-07-25 13:21:46 -04:00
parent 2f2f71948a
commit 6eaeee5f57
26 changed files with 776 additions and 249 deletions

152
forms/palettecolorsearch.ui Normal file
View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PaletteColorSearch</class>
<widget class="QDialog" name="PaletteColorSearch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>547</width>
<height>329</height>
</rect>
</property>
<property name="windowTitle">
<string>Palette Color Search</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="searchBar">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame_Color">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Color">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_ColorId">
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Palette">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Palette</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_PaletteId"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTableWidget" name="table_Results">
<property name="columnCount">
<number>2</number>
</property>
<column/>
<column/>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -38,6 +38,20 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_ColorSearch">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Opens a search dialog to find which tilesets/metatiles are using certain colors.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/magnifier.ico</normaloff>:/icons/magnifier.ico</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_AllColorsUsed">
<property name="text">
@@ -96,7 +110,7 @@
<x>0</x>
<y>0</y>
<width>883</width>
<height>784</height>
<height>779</height>
</rect>
</property>
<layout class="QGridLayout" name="layout_Colors">
@@ -146,9 +160,16 @@
</property>
<addaction name="actionShow_Unused_Colors"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
<string>Tools</string>
</property>
<addaction name="actionFind_Color_Usage"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuEdit"/>
<addaction name="menuView"/>
<addaction name="menuTools"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionUndo">
@@ -186,7 +207,14 @@
<string>Show Unused Colors</string>
</property>
</action>
<action name="actionFind_Color_Usage">
<property name="text">
<string>Find Color Usage...</string>
</property>
</action>
</widget>
<resources/>
<resources>
<include location="../resources/images.qrc"/>
</resources>
<connections/>
</ui>