OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <gdk/gdk.h> | 5 #include <gdk/gdk.h> |
6 #include <gtk/gtk.h> | 6 #include <gtk/gtk.h> |
7 | 7 |
8 #include "chrome/common/owned_widget_gtk.h" | 8 #include "chrome/common/owned_widget_gtk.h" |
9 | 9 |
10 // Creates a link button that shows |text| in blue and underlined. The cursor | 10 // Creates a link button that shows |text| in blue and underlined. The cursor |
11 // changes to a hand when over the link. | 11 // changes to a hand when over the link. |
12 // TODO(estade): the link should turn red during the user's click. | |
13 class LinkButtonGtk { | 12 class LinkButtonGtk { |
14 public: | 13 public: |
15 explicit LinkButtonGtk(const char* text); | 14 explicit LinkButtonGtk(const char* text); |
16 virtual ~LinkButtonGtk(); | 15 virtual ~LinkButtonGtk(); |
17 | 16 |
18 GtkWidget* widget() { return widget_.get(); } | 17 GtkWidget* widget() { return widget_.get(); } |
19 | 18 |
20 GtkWidget* label() { return label_; } | 19 GtkWidget* label() { return label_; } |
21 | 20 |
22 private: | 21 private: |
(...skipping 21 matching lines...) Expand all Loading... |
44 // user mouses over the link. | 43 // user mouses over the link. |
45 GdkCursor* hand_cursor_; | 44 GdkCursor* hand_cursor_; |
46 | 45 |
47 // Text markup for the link. We use the red one when the link is being | 46 // Text markup for the link. We use the red one when the link is being |
48 // clicked. | 47 // clicked. |
49 gchar* blue_markup; | 48 gchar* blue_markup; |
50 gchar* red_markup; | 49 gchar* red_markup; |
51 // The current state of the text. | 50 // The current state of the text. |
52 bool is_blue_; | 51 bool is_blue_; |
53 }; | 52 }; |
OLD | NEW |