summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/menu_config_gtk.cc
blob: 971490bdb30479a8a9489f6613e5ce1f957f0484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "views/controls/menu/menu_config.h"

#include "app/resource_bundle.h"
#include "grit/app_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"

namespace views {

// static
MenuConfig* MenuConfig::Create() {
  MenuConfig* config = new MenuConfig();
  ResourceBundle& rb = ResourceBundle::GetSharedInstance();
  config->font = rb.GetFont(ResourceBundle::BaseFont);
  config->arrow_width = rb.GetBitmapNamed(IDR_MENU_ARROW)->width();
  // Add 4 to force some padding between check and label.
  config->check_width = rb.GetBitmapNamed(IDR_MENU_CHECK)->width() + 4;
  config->check_height = rb.GetBitmapNamed(IDR_MENU_CHECK)->height();
  return config;
}

}  // namespace views