Skip to content

Commit 456d648

Browse files
sebgodclaude
andcommitted
Fix device discovery: include fake devices, size Discover button to text
- Remove FakeDevice filter from GUI discovery so fake mounts/cameras appear - Size Discover button dynamically to fit "Discovering..." label text Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6169614 commit 456d648

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/TianWen.UI.Gui/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ void HandleEquipmentClick(EquipmentHitResult hit)
487487
eqState.DiscoveredDevices = [.. dm.RegisteredDeviceTypes
488488
.Where(t => t is not DeviceType.Profile and not DeviceType.None)
489489
.SelectMany(dm.RegisteredDevices)
490-
.Where(d => d is not TianWen.Lib.Devices.Fake.FakeDevice)
491490
.OrderBy(d => d.DeviceType).ThenBy(d => d.DisplayName)];
492491
}
493492
catch (Exception ex)

src/TianWen.UI.Gui/VkEquipmentTab.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ private void RenderDeviceList(
516516

517517
// [Discover] button at the bottom of the list area
518518
var discoverBtnY = y + h - buttonH - padding;
519-
var discoverBtnW = 100f * dpiScale;
520-
var discoverBtnX = x + padding;
521519
var discoverLabel = State.IsDiscovering ? "Discovering..." : "Discover";
520+
var discoverBtnW = _renderer.MeasureText(discoverLabel.AsSpan(), fontPath, fontSize).Width + padding * 4f;
521+
var discoverBtnX = x + padding;
522522

523523
FillRect(discoverBtnX, discoverBtnY, discoverBtnW, buttonH, CreateButton);
524524
RegisterClickable(discoverBtnX, discoverBtnY, discoverBtnW, buttonH, new EquipmentHitResult(EquipmentHitType.DiscoverButton));

0 commit comments

Comments
 (0)