Changeset 134694 in webkit
- Timestamp:
- Nov 14, 2012, 4:49:59 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r134693 r134694 1 2012-11-14 Ryuan Choi <ryuan.choi@gmail.com> 2 3 [EFL] Refactor theme to choose whether to support foreground color of selection 4 https://bugs.webkit.org/show_bug.cgi?id=102037 5 6 Reviewed by Gyuyoung Kim. 7 8 RenderThemeEfl can change foreground color of selection using theme file. 9 But it can not disable supports of foreground color to keep the text color 10 which is selected. 11 12 This patch refactors color classes of theme file from active/inactive classes 13 to foreground/background classes so that RenderThemeEfl checks whether 14 theme file supports foreground color class. 15 16 * platform/efl/RenderThemeEfl.cpp: 17 (WebCore::fillColorsFromEdjeClass): 18 (WebCore::RenderThemeEfl::setColorFromThemeClass): 19 (WebCore::RenderThemeEfl::loadTheme): 20 (WebCore::RenderThemeEfl::RenderThemeEfl): 21 (WebCore::RenderThemeEfl::supportsSelectionForegroundColors): 22 (WebCore): 23 * platform/efl/RenderThemeEfl.h: 24 (RenderThemeEfl): 25 1 26 2012-11-14 Tony Chang <tony@chromium.org> 2 27 -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp
r132112 r134694 415 415 } 416 416 417 static voidfillColorsFromEdjeClass(Evas_Object* o, const char* colorClass, Color* color1, Color* color2 = 0, Color* color3 = 0)417 static bool fillColorsFromEdjeClass(Evas_Object* o, const char* colorClass, Color* color1, Color* color2 = 0, Color* color3 = 0) 418 418 { 419 419 int r1, g1, b1, a1; … … 422 422 423 423 bool ok = edje_object_color_class_get(o, colorClass, &r1, &g1, &b1, &a1, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3); 424 _ASSERT_ON_RELEASE_RETURN (ok, "Could not get color class '%s'\n", colorClass);424 _ASSERT_ON_RELEASE_RETURN_VAL(ok, false, "Could not get color class '%s'\n", colorClass); 425 425 426 426 if (color1) … … 430 430 if (color3) 431 431 color3->setRGB(makeRGBA(r3, g3, b3, a3)); 432 433 return true; 432 434 } 433 435 … … 436 438 ASSERT(edje()); 437 439 438 if (!strcmp("webkit/selection/ active", colorClass))439 fillColorsFromEdjeClass(edje(), colorClass, &m_activeSelectionForegroundColor, &m_activeSelectionBackgroundColor);440 else if (!strcmp("webkit/selection/ inactive", colorClass))441 fillColorsFromEdjeClass(edje(), colorClass, &m_ inactiveSelectionForegroundColor, &m_inactiveSelectionBackgroundColor);440 if (!strcmp("webkit/selection/foreground", colorClass)) 441 m_supportsSelectionForegroundColor = fillColorsFromEdjeClass(edje(), colorClass, &m_activeSelectionForegroundColor, &m_inactiveSelectionForegroundColor); 442 else if (!strcmp("webkit/selection/background", colorClass)) 443 fillColorsFromEdjeClass(edje(), colorClass, &m_activeSelectionBackgroundColor, &m_inactiveSelectionBackgroundColor); 442 444 else if (!strcmp("webkit/focus_ring", colorClass)) { 443 445 fillColorsFromEdjeClass(edje(), colorClass, &m_focusRingColor); … … 502 504 m_edje = o; 503 505 504 edje_object_signal_callback_add(edje(), "color_class,set", "webkit/selection/ active", applyColorCallback, this);505 edje_object_signal_callback_add(edje(), "color_class,set", "webkit/selection/ inactive", applyColorCallback, this);506 edje_object_signal_callback_add(edje(), "color_class,set", "webkit/selection/foreground", applyColorCallback, this); 507 edje_object_signal_callback_add(edje(), "color_class,set", "webkit/selection/background", applyColorCallback, this); 506 508 edje_object_signal_callback_add(edje(), "color_class,set", "webkit/focus_ring", applyColorCallback, this); 507 509 508 510 applyPartDescriptionsFrom(m_themePath); 509 511 510 setColorFromThemeClass("webkit/selection/ active");511 setColorFromThemeClass("webkit/selection/ inactive");512 setColorFromThemeClass("webkit/selection/foreground"); 513 setColorFromThemeClass("webkit/selection/background"); 512 514 setColorFromThemeClass("webkit/focus_ring"); 513 515 … … 607 609 , m_mediaSliderColor(Color::white) 608 610 #endif 611 , m_supportsSelectionForegroundColor(false) 609 612 { 610 613 } … … 684 687 loadThemeIfNeeded(); 685 688 return m_focusRingColor; 689 } 690 691 bool RenderThemeEfl::supportsSelectionForegroundColors() const 692 { 693 loadThemeIfNeeded(); 694 return m_supportsSelectionForegroundColor; 686 695 } 687 696 -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.h
r132112 r134694 95 95 // A general method asking if any control tinting is supported at all. 96 96 virtual bool supportsControlTints() const { return true; } 97 98 // A general method asking if foreground colors of selection are supported. 99 virtual bool supportsSelectionForegroundColors() const; 97 100 98 101 // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline … … 254 257 RefPtr<Evas_Object> m_edje; 255 258 259 bool m_supportsSelectionForegroundColor; 260 256 261 struct ThemePartDesc { 257 262 FormType type; -
trunk/Source/WebKit/efl/ChangeLog
r134365 r134694 1 2012-11-14 Ryuan Choi <ryuan.choi@gmail.com> 2 3 [EFL] Refactor theme to choose whether to support foreground color of selection 4 https://bugs.webkit.org/show_bug.cgi?id=102037 5 6 Reviewed by Gyuyoung Kim. 7 8 * DefaultTheme/default.edc: 9 Refactored color classes from active/inactive to foreground/background. 10 1 11 2012-11-12 KyungTae Kim <ktf.kim@samsung.com> 2 12 -
trunk/Source/WebKit/efl/DefaultTheme/default.edc
r128049 r134694 22 22 color_classes { 23 23 color_class { 24 name: "webkit/selection/ active";25 color: 255 255 255 255; /* foreground*/26 color2: 86 86 209 255; /* background*/24 name: "webkit/selection/foreground"; 25 color: 255 255 255 255; /* active */ 26 color2: 255 255 255 255; /* inactive */ 27 27 } 28 28 color_class { 29 name: "webkit/selection/ inactive";30 color: 255 255 255 255; /* foreground*/31 color2: 0 0 128 128; /* background*/29 name: "webkit/selection/background"; 30 color: 86 86 209 255; /* active */ 31 color2: 0 0 128 128; /* inactive */ 32 32 } 33 33 color_class {
Note:
See TracChangeset
for help on using the changeset viewer.