Ver código fonte

GVariant: Tweak stringification of Color, Boolean and Invalid variants.

Andreas Kling 6 anos atrás
pai
commit
3674bb9429
2 arquivos alterados com 3 adições e 3 exclusões
  1. 2 2
      LibGUI/GVariant.cpp
  2. 1 1
      SharedGraphics/Color.cpp

+ 2 - 2
LibGUI/GVariant.cpp

@@ -216,7 +216,7 @@ String GVariant::to_string() const
 {
 {
     switch (m_type) {
     switch (m_type) {
     case Type::Bool:
     case Type::Bool:
-        return as_bool() ? "True" : "False";
+        return as_bool() ? "true" : "false";
     case Type::Int:
     case Type::Int:
         return String::format("%d", as_int());
         return String::format("%d", as_int());
     case Type::Float:
     case Type::Float:
@@ -236,7 +236,7 @@ String GVariant::to_string() const
     case Type::Rect:
     case Type::Rect:
         return as_rect().to_string();
         return as_rect().to_string();
     case Type::Invalid:
     case Type::Invalid:
-        return "[Null]";
+        return "[null]";
         break;
         break;
     }
     }
     ASSERT_NOT_REACHED();
     ASSERT_NOT_REACHED();

+ 1 - 1
SharedGraphics/Color.cpp

@@ -35,5 +35,5 @@ Color::Color(NamedColor named)
 
 
 String Color::to_string() const
 String Color::to_string() const
 {
 {
-    return String::format("rgba(%d, %d, %d, %d)", red(), green(), blue(), alpha());
+    return String::format("#%b%b%b%b", red(), green(), blue(), alpha());
 }
 }