2010-12-24 Carlos Garcia Campos <cgarcia@igalia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Dec 2010 19:02:25 +0000 (19:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Dec 2010 19:02:25 +0000 (19:02 +0000)
        Reviewed by Xan Lopez.

        [GTK] Show current time / total in media player
        https://bugs.webkit.org/show_bug.cgi?id=51535

        * css/mediaControlsGtk.css:
        (audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display):
        * platform/gtk/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::formatMediaControlsCurrentTime):
        (WebCore::RenderThemeGtk::paintMediaCurrentTime):
        * platform/gtk/RenderThemeGtk.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74643 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/css/mediaControlsGtk.css
WebCore/platform/gtk/RenderThemeGtk.cpp
WebCore/platform/gtk/RenderThemeGtk.h

index c3343f2ffeee6f35cbb946abaa7490ed466caa1c..9afb41869532d5c802caff25607e13062b01a841 100644 (file)
@@ -1,3 +1,17 @@
+2010-12-24  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Show current time / total in media player
+        https://bugs.webkit.org/show_bug.cgi?id=51535
+
+        * css/mediaControlsGtk.css:
+        (audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display):
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::formatMediaControlsCurrentTime):
+        (WebCore::RenderThemeGtk::paintMediaCurrentTime):
+        * platform/gtk/RenderThemeGtk.h:
+
 2010-12-24  Jan Erik Hanssen  <jhanssen@sencha.com>
 
         Reviewed by Eric Seidel.
 2010-12-24  Jan Erik Hanssen  <jhanssen@sencha.com>
 
         Reviewed by Eric Seidel.
index cc6da142966e902be8088040d2b4d0dff718f14e..18b7dccc6618870b4443b88f3f46656e63e96b50 100644 (file)
@@ -49,6 +49,18 @@ audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
     height: 20px;
 }
 
     height: 20px;
 }
 
+audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display {
+    -webkit-appearance: media-current-time-display;
+    -webkit-user-select: none;
+    display: inline-block;
+    height: 20px;
+
+    padding: 5px;
+
+    text-align: center;
+    font-size: 10px;
+}
+
 audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
     width: 20px;
     height: 20px;
 audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
     width: 20px;
     height: 20px;
index 73b2d6bddf88dce638ca1bcad21242fdfcb6d212..d34847dc48d9e44caf026196ed3c05819b8fc41c 100644 (file)
@@ -1006,6 +1006,19 @@ bool RenderThemeGtk::paintMediaSliderThumb(RenderObject* o, const PaintInfo& pai
     paintInfo.context->fillRoundedRect(r, IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), m_sliderThumbColor, ColorSpaceDeviceRGB);
     return false;
 }
     paintInfo.context->fillRoundedRect(r, IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), m_sliderThumbColor, ColorSpaceDeviceRGB);
     return false;
 }
+
+String RenderThemeGtk::formatMediaControlsCurrentTime(float currentTime, float duration) const
+{
+    return formatMediaControlsTime(currentTime) + " / " + formatMediaControlsTime(duration);
+}
+
+bool RenderThemeGtk::paintMediaCurrentTime(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+{
+    GraphicsContext* context = paintInfo.context;
+
+    context->fillRect(FloatRect(rect), m_panelColor, ColorSpaceDeviceRGB);
+    return false;
+}
 #endif
 
 #if ENABLE(PROGRESS_TAG)
 #endif
 
 #if ENABLE(PROGRESS_TAG)
index d377c45da2a938b62585ea802e7ceaf2801bfeed..2ec1881a2a99a305e622dfc3cac6417bf1981aa0 100644 (file)
@@ -81,6 +81,7 @@ public:
 
 #if ENABLE(VIDEO)
     virtual String extraMediaControlsStyleSheet();
 
 #if ENABLE(VIDEO)
     virtual String extraMediaControlsStyleSheet();
+    virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
 #endif
 
     void getIndicatorMetrics(ControlPart, int& indicatorSize, int& indicatorSpacing) const;
 #endif
 
     void getIndicatorMetrics(ControlPart, int& indicatorSize, int& indicatorSpacing) const;
@@ -147,6 +148,7 @@ protected:
     virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&);
 #endif
 
 #if ENABLE(PROGRESS_TAG)
 #endif
 
 #if ENABLE(PROGRESS_TAG)