10
submitted 1 year ago* (last edited 1 year ago) by sabreW4K3@lemmy.tf to c/firefox@lemmy.ml

Is this fairly simple patch a step in the right direction?

diff --git a/browser/components/tabs/TabStack.kt b/browser/components/tabs/TabStack.kt
index 99684d7..50b0304 100644
***
a/browser/components/tabs/TabStack.kt
+++ b/browser/components/tabs/TabStack.kt
@@ -41,6 +41,7 @@ class TabStack(
     val tabs: List = emptyList(),
     val onTabSelected: (Tab) -> Unit = {}
 ) : FrameLayout(context) {
+    val tabStackCompose = TabStackCompose(tabs, onTabSelected)

     override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
         super.onMeasure(widthMeasureSpec, heightMeasureSpec)
@@ -54,6 +55,17 @@ class TabStack(
         tabStackCompose.measure(widthMeasureSpec, heightMeasureSpec)
     }

+    override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
+        tabStackCompose.layout(left, top, right, bottom)
+    }
+
+    companion object {
+        fun create(tabs: List, onTabSelected: (Tab) -> Unit = {}): TabStack {
+            return TabStack(tabs, onTabSelected)
+        }
+    }
 }
top 1 comments
sorted by: hot top controversial new old
[-] sabreW4K3@lemmy.tf 1 points 1 year ago

Betteridge's Law of Headlines says No, but I don't know enough about the code to say yes or no for sure

this post was submitted on 15 Aug 2023
10 points (100.0% liked)

Firefox

17302 readers
227 users here now

A place to discuss the news and latest developments on the open-source browser Firefox

founded 4 years ago
MODERATORS