diff --git a/client/android/app/src/main/java/cloud/betterportal/frame/CameraTile.kt b/client/android/app/src/main/java/cloud/betterportal/frame/CameraTile.kt index 55f2a6e..67a25a4 100644 --- a/client/android/app/src/main/java/cloud/betterportal/frame/CameraTile.kt +++ b/client/android/app/src/main/java/cloud/betterportal/frame/CameraTile.kt @@ -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) @@ -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 diff --git a/client/src/platform/linux/ui.rs b/client/src/platform/linux/ui.rs index 4fbdc5c..f4599f9 100644 --- a/client/src/platform/linux/ui.rs +++ b/client/src/platform/linux/ui.rs @@ -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 diff --git a/client/src/platform/windows/renderer.rs b/client/src/platform/windows/renderer.rs index dd50ce4..4e923f3 100644 --- a/client/src/platform/windows/renderer.rs +++ b/client/src/platform/windows/renderer.rs @@ -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::*; @@ -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, + ); } }