Media Kit: Rewrite DefaultMediaTheme to use layouts.

The old fixed-rect method was very error-prone in corner-cases,
resulting in half-visible (cut off) parameters, incorrectly
sized controls, etc. on various devices, which often made it
impossible to use.

While there are still a few rough edges (scrollbar behavior could
be further improved, though it's already much better than it was before),
this method is much better than the previous one.

Fixes #11592 and related tickets.

Change-Id: I65175f760bda98e42d1fc68ba8e526470bf17c25
Reviewed-on: https://review.haiku-os.org/c/889
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Augustin Cavalier
2019-01-22 14:25:09 +00:00
committed by waddlesplash
parent 658362336e
commit a4f5124fcc
2 changed files with 134 additions and 559 deletions
+6 -6
View File
@@ -14,21 +14,21 @@ class BParameterGroup;
namespace BPrivate {
class DefaultMediaTheme : public BMediaTheme {
public:
public:
DefaultMediaTheme();
virtual BControl* MakeControlFor(BParameter* parameter);
static BControl* MakeViewFor(BParameter* parameter, const BRect* hintRect = NULL);
static BControl* MakeViewFor(BParameter* parameter);
// this is also called by the BMediaTheme::MakeFallbackViewFor()
// method - that's why it's a static.
protected:
protected:
virtual BView* MakeViewFor(BParameterWeb* web, const BRect* hintRect = NULL);
private:
BView* MakeViewFor(BParameterGroup& group, const BRect* hintRect);
BView* MakeSelfHostingViewFor(BParameter& parameter, const BRect* hintRect);
private:
BView* MakeViewFor(BParameterGroup& group);
BView* MakeSelfHostingViewFor(BParameter& parameter);
};
} // namespace BPrivate