Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class CameraTile(context: Context, cell: JSONObject, onExpand: () -> Unit) : Vie
private val errorMessage = message("").apply { setBackgroundColor(Color.BLACK); visibility = View.GONE }
private val label = TextView(context).apply {
text = cell.optString("label", "Camera")
setSingleLine(true)
ellipsize = android.text.TextUtils.TruncateAt.END
setTextColor(Color.WHITE)
setBackgroundColor(0x99000000.toInt())
setPadding(12, 8, 12, 8)
Expand Down Expand Up @@ -105,7 +107,7 @@ class CameraTile(context: Context, cell: JSONObject, onExpand: () -> Unit) : Vie
status.addView(errorMessage, LayoutParams(-1, -1))
status.addView(spinner, LayoutParams(spinnerSize, spinnerSize, Gravity.CENTER))
addView(status, LayoutParams(-1, -1))
addView(label, LayoutParams(-1, -2, Gravity.BOTTOM))
addView(label, LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM or Gravity.START))
// This app-owned surface is the single TV focus target and touch expand control.
addView(View(context).apply {
isFocusable = true
Expand Down
19 changes: 0 additions & 19 deletions client/src/platform/linux/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2097,25 +2097,6 @@ fn render_layout_inner(display_id: &str, layout_id: &str, preserve_override: boo
&name_label,
"label { background: rgba(0,0,0,0.7); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 3px; }",
);
let overlay_weak = overlay.downgrade();
let name_label_weak = name_label.downgrade();
overlay.add_tick_callback(move |_, _| {
let Some(overlay) = overlay_weak.upgrade() else {
return gtk::glib::ControlFlow::Break;
};
let Some(name_label) = name_label_weak.upgrade() else {
return gtk::glib::ControlFlow::Break;
};

let tile_width = overlay.allocated_width();
if tile_width > 0 {
name_label
.set_width_request(((tile_width as f64) * 0.9) as i32);
return gtk::glib::ControlFlow::Break;
}

gtk::glib::ControlFlow::Continue
});
overlay.add_overlay(&name_label);

// Top-left badge row: stream type + status icon
Expand Down
10 changes: 8 additions & 2 deletions client/src/platform/windows/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use windows_sys::Win32::UI::WindowsAndMessaging::{
WM_COMMAND, WM_KEYDOWN, GetDlgItem, IsWindowVisible, SetWindowTextW, SetWindowPos,
HWND_TOP, SWP_NOACTIVATE, WS_CHILD, WS_VISIBLE, WS_TABSTOP, SW_SHOW, SW_HIDE,
};
use windows_sys::Win32::Graphics::Gdi::DT_WORDBREAK;
use windows_sys::Win32::Graphics::Gdi::{DT_END_ELLIPSIS, DT_NOPREFIX, DT_WORDBREAK};

use super::*;

Expand Down Expand Up @@ -680,7 +680,13 @@ pub(super) fn draw_cell_label(hdc: HDC, rect: RECT, text: &str) {
};
unsafe {
SetTextColor(hdc, rgb(243, 244, 246));
DrawTextW(hdc, text_w.as_ptr(), -1, &mut text_rect, DT_LEFT | DT_TOP);
DrawTextW(
hdc,
text_w.as_ptr(),
-1,
&mut text_rect,
DT_LEFT | DT_TOP | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX,
);
}
}

Expand Down
Loading