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

Firefox

20396 readers
375 users here now

/c/firefox

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


Rules

1. Adhere to the instance rules

2. Be kind to one another

3. Communicate in a civil manner


Reporting

If you would like to bring an issue to the moderators attention, please use the "Create Report" feature on the offending comment or post and it will be reviewed as time allows.


founded 5 years ago
MODERATORS
10
submitted 2 years ago* (last edited 2 years 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)
+        }
+    }
 }
you are viewing a single comment's thread
view the rest of the comments
[–] sabreW4K3@lemmy.tf 1 points 2 years ago

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