Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: chrome/browser/ui/gtk/browser_titlebar.cc

Issue 17544002: Adjust avatar menu and avatar label to the look on windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/avatar_menu_bubble_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/gtk/browser_titlebar.h" 5 #include "chrome/browser/ui/gtk/browser_titlebar.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 void BrowserTitlebar::UpdateAvatarLabel() { 777 void BrowserTitlebar::UpdateAvatarLabel() {
778 if (theme_service_ && avatar_label_) { 778 if (theme_service_ && avatar_label_) {
779 GdkColor text_color = 779 GdkColor text_color =
780 theme_service_->GetGdkColor(ThemeProperties::COLOR_MANAGED_USER_LABEL); 780 theme_service_->GetGdkColor(ThemeProperties::COLOR_MANAGED_USER_LABEL);
781 GdkColor label_background = theme_service_->GetGdkColor( 781 GdkColor label_background = theme_service_->GetGdkColor(
782 ThemeProperties::COLOR_MANAGED_USER_LABEL_BACKGROUND); 782 ThemeProperties::COLOR_MANAGED_USER_LABEL_BACKGROUND);
783 gtk_util::SetLabelColor(avatar_label_, &text_color); 783 gtk_util::SetLabelColor(avatar_label_, &text_color);
784 gtk_widget_modify_bg( 784 gtk_widget_modify_bg(
785 GTK_WIDGET(avatar_label_bg_), GTK_STATE_NORMAL, &label_background); 785 GTK_WIDGET(avatar_label_bg_), GTK_STATE_NORMAL, &label_background);
786 char* markup = g_markup_printf_escaped( 786 char* markup = g_markup_printf_escaped(
787 "<span size='small' weight='bold'>%s</span>", 787 "<span size='small'>%s</span>",
788 l10n_util::GetStringUTF8(IDS_MANAGED_USER_AVATAR_LABEL).c_str()); 788 l10n_util::GetStringUTF8(IDS_MANAGED_USER_AVATAR_LABEL).c_str());
789 gtk_label_set_markup(GTK_LABEL(avatar_label_), markup); 789 gtk_label_set_markup(GTK_LABEL(avatar_label_), markup);
790 g_free(markup); 790 g_free(markup);
791 } 791 }
792 } 792 }
793 793
794 void BrowserTitlebar::UpdateAvatar() { 794 void BrowserTitlebar::UpdateAvatar() {
795 // Remove previous state. 795 // Remove previous state.
796 gtk_util::RemoveAllChildren(titlebar_left_avatar_frame_); 796 gtk_util::RemoveAllChildren(titlebar_left_avatar_frame_);
797 gtk_util::RemoveAllChildren(titlebar_right_avatar_frame_); 797 gtk_util::RemoveAllChildren(titlebar_right_avatar_frame_);
(...skipping 15 matching lines...) Expand all
813 // Use a clickable avatar. 813 // Use a clickable avatar.
814 avatar_ = avatar_button_->widget(); 814 avatar_ = avatar_button_->widget();
815 } 815 }
816 } 816 }
817 817
818 gtk_widget_show_all(avatar_); 818 gtk_widget_show_all(avatar_);
819 819
820 Profile* profile = browser_window_->browser()->profile(); 820 Profile* profile = browser_window_->browser()->profile();
821 if (ManagedUserService::ProfileIsManaged(profile)) { 821 if (ManagedUserService::ProfileIsManaged(profile)) {
822 avatar_label_ = gtk_label_new(NULL); 822 avatar_label_ = gtk_label_new(NULL);
823 gtk_misc_set_padding(GTK_MISC(avatar_label_), 2, 2); 823 gtk_misc_set_padding(GTK_MISC(avatar_label_), 10, 2);
824 avatar_label_bg_ = gtk_event_box_new(); 824 avatar_label_bg_ = gtk_event_box_new();
825 gtk_container_add(GTK_CONTAINER(avatar_label_bg_), avatar_label_); 825 gtk_container_add(GTK_CONTAINER(avatar_label_bg_), avatar_label_);
826 g_signal_connect(avatar_label_bg_, "button-press-event", 826 g_signal_connect(avatar_label_bg_, "button-press-event",
827 G_CALLBACK(OnAvatarLabelButtonPressedThunk), this); 827 G_CALLBACK(OnAvatarLabelButtonPressedThunk), this);
828 UpdateAvatarLabel(); 828 UpdateAvatarLabel();
829 gtk_widget_show(avatar_label_bg_); 829 gtk_widget_show(avatar_label_bg_);
830 gtk_widget_show(avatar_label_); 830 gtk_widget_show(avatar_label_);
831 if (display_avatar_on_left_) { 831 if (display_avatar_on_left_) {
832 gtk_container_add(GTK_CONTAINER(titlebar_left_label_frame_), 832 gtk_container_add(GTK_CONTAINER(titlebar_left_label_frame_),
833 avatar_label_bg_); 833 avatar_label_bg_);
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 ui::SimpleMenuModel::Delegate* delegate) 1101 ui::SimpleMenuModel::Delegate* delegate)
1102 : SimpleMenuModel(delegate) { 1102 : SimpleMenuModel(delegate) {
1103 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); 1103 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB);
1104 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); 1104 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB);
1105 AddSeparator(ui::NORMAL_SEPARATOR); 1105 AddSeparator(ui::NORMAL_SEPARATOR);
1106 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); 1106 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
1107 AddSeparator(ui::NORMAL_SEPARATOR); 1107 AddSeparator(ui::NORMAL_SEPARATOR);
1108 AddCheckItemWithStringId(kShowWindowDecorationsCommand, 1108 AddCheckItemWithStringId(kShowWindowDecorationsCommand,
1109 IDS_SHOW_WINDOW_DECORATIONS_MENU); 1109 IDS_SHOW_WINDOW_DECORATIONS_MENU);
1110 } 1110 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/avatar_menu_bubble_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698