~jeremywootten/pantheon-files/fix-1604300-merge-find-functionalities-part1

« back to all changes in this revision

Viewing changes to libwidgets/Chrome/XsEntry.vala

  • Committer: Jeremy Wootten
  • Date: 2017-01-13 13:31:06 UTC
  • mfrom: (2412.1.32 pantheon-files)
  • Revision ID: jeremy@elementaryos.org-20170113133106-v9l164ms13lh3p0a
Merge trunk to r2444 and resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***
2
 
    Copyright (c) 2011-2016 elementary LLC (http://launchpad.net/elementary)
3
 
 
4
 
    This program is free software: you can redistribute it and/or modify
5
 
    it under the terms of the GNU General Public License as published by
6
 
    the Free Software Foundation, either version 3 of the License, or
7
 
    (at your option) any later version.
8
 
 
9
 
    This program is distributed in the hope that it will be useful,
10
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
    GNU General Public License for more details.
13
 
 
14
 
    You should have received a copy of the GNU General Public License
15
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 
 
17
 
***/
18
 
 
19
 
/* Just a workarround Gtk.Entry which got a minimum fixed prefered width.
20
 
   With XsEntry we can set the exact width we want */
21
 
public class Granite.Widgets.XsEntry : Gtk.Entry {
22
 
    public int m_default_with = 25;
23
 
 
24
 
    public XsEntry () {
25
 
        width_request = m_default_with;
26
 
    }
27
 
 
28
 
    public override void get_preferred_width (out int minimum_width, out int natural_width) {
29
 
        if (width_request >= m_default_with)
30
 
            minimum_width = natural_width = width_request;
31
 
        else
32
 
            minimum_width = natural_width = m_default_with;
33
 
    }
34
 
}