mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-03-30 11:51:12 -04:00
Fix DeviceView clicking on Zone and Segment names
This commit is contained in:
@@ -607,6 +607,8 @@ void DeviceView::mouseReleaseEvent(QMouseEvent* event)
|
||||
offset_x = (width() - size) / 2;
|
||||
}
|
||||
|
||||
unsigned int segment_count = 0;
|
||||
|
||||
for(std::size_t zone_idx = 0; zone_idx < controller->zones.size(); zone_idx++)
|
||||
{
|
||||
int posx = zone_pos[zone_idx].matrix_x * size + offset_x + 12;
|
||||
@@ -620,6 +622,23 @@ void DeviceView::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
selectZone(zone_idx, ctrlDown);
|
||||
}
|
||||
|
||||
for(std::size_t segment_idx = 0; segment_idx < controller->zones[zone_idx].segments.size(); segment_idx++)
|
||||
{
|
||||
posx = segment_pos[segment_count].matrix_x * size + offset_x + 12;
|
||||
posy = segment_pos[segment_count].matrix_y * size;
|
||||
posw = segment_pos[segment_count].matrix_w * size;
|
||||
posh = segment_pos[segment_count].matrix_h * size;
|
||||
|
||||
segment_count++;
|
||||
|
||||
rect = {posx, posy, posw, posh};
|
||||
|
||||
if(rect.contains(event->pos()))
|
||||
{
|
||||
selectSegment(zone_idx, segment_idx, ctrlDown);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user